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" <lukasz.dorau@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-08-05 15:40:16 +10:00
parent 92939eb291
commit e49a8a8026
1 changed files with 5 additions and 3 deletions

View File

@ -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;