From: NeilBrown Date: Mon, 5 Aug 2013 05:40:16 +0000 (+1000) Subject: mdmon: don't use 'ghost' values from an inactive array. X-Git-Tag: mdadm-3.3~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e49a8a80265ab2150c96b636450f5825bcd69d4a;p=thirdparty%2Fmdadm.git mdmon: don't use 'ghost' values from an inactive array. It is possible for mdmon to see (in /proc/mdstat) and array in 'inactive' state, "mdadm -S" has written "inactive" to "array_state". In this state values such as "raid_disk" are not meaningful and so should be ignored by manage_member(). Reported-by: "Dorau, Lukasz" Signed-off-by: NeilBrown --- diff --git a/managemon.c b/managemon.c index c2456557..f40bbdb3 100644 --- a/managemon.c +++ b/managemon.c @@ -450,9 +450,11 @@ static void manage_member(struct mdstat_ent *mdstat, /* Raced with something */ return; - // FIXME - a->info.array.raid_disks = mdstat->raid_disks; - // MORE + if (mdstat->active) { + // FIXME + a->info.array.raid_disks = mdstat->raid_disks; + // MORE + } if (sysfs_get_ll(&a->info, NULL, "component_size", &component_size) >= 0) a->info.component_size = component_size << 1;