dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm-3.2.6-mdmon-don-t-use-ghost-values-from-an-inactive-array.patch

fc6001
From e49a8a80265ab2150c96b636450f5825bcd69d4a Mon Sep 17 00:00:00 2001
fc6001
From: NeilBrown <neilb@suse.de>
fc6001
Date: Mon, 5 Aug 2013 15:40:16 +1000
fc6001
Subject: [PATCH] mdmon: don't use 'ghost' values from an inactive array.
fc6001
fc6001
It is possible for mdmon to see (in /proc/mdstat) and array
fc6001
in 'inactive' state, "mdadm -S" has written "inactive" to
fc6001
"array_state".
fc6001
fc6001
In this state values such as "raid_disk" are not meaningful
fc6001
and so should be ignored by manage_member().
fc6001
fc6001
Reported-by: "Dorau, Lukasz" <lukasz.dorau@intel.com>
fc6001
Signed-off-by: NeilBrown <neilb@suse.de>
fc6001
---
fc6001
 managemon.c | 8 +++++---
fc6001
 1 file changed, 5 insertions(+), 3 deletions(-)
fc6001
fc6001
diff --git a/managemon.c b/managemon.c
fc6001
index c245655..f40bbdb 100644
fc6001
--- a/managemon.c
fc6001
+++ b/managemon.c
fc6001
@@ -450,9 +450,11 @@ static void manage_member(struct mdstat_ent *mdstat,
fc6001
 		/* Raced with something */
fc6001
 		return;
fc6001
 
fc6001
-	// FIXME
fc6001
-	a->info.array.raid_disks = mdstat->raid_disks;
fc6001
-	// MORE
fc6001
+	if (mdstat->active) {
fc6001
+		// FIXME
fc6001
+		a->info.array.raid_disks = mdstat->raid_disks;
fc6001
+		// MORE
fc6001
+	}
fc6001
 
fc6001
 	if (sysfs_get_ll(&a->info, NULL, "component_size", &component_size) >= 0)
fc6001
 		a->info.component_size = component_size << 1;
fc6001
-- 
fc6001
1.8.5.3
fc6001