imsm: fix: correct checking newly missing disks

The problem occurs when RAID10 array under rebuild
(after one disk fails) is assembled incrementally.
Mdadm tries to start array just after adding the third disk
and the volume is assembled incorrectly (in degraded state).

The cause is that container_enough depends on
newly missing disks which are checked incorrectly now.
They should be checked using always the first map.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Lukasz Dorau 2011-11-14 15:52:52 +01:00 committed by NeilBrown
parent 3baa56ab61
commit a510b1c7f0
1 changed files with 2 additions and 2 deletions

View File

@ -2529,13 +2529,13 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char *
failed = imsm_count_failed(super, dev);
state = imsm_check_degraded(super, dev, failed);
map = get_imsm_map(dev, dev->vol.migr_state);
map = get_imsm_map(dev, 0);
/* any newly missing disks?
* (catches single-degraded vs double-degraded)
*/
for (j = 0; j < map->num_members; j++) {
__u32 ord = get_imsm_ord_tbl_ent(dev, i, -1);
__u32 ord = get_imsm_ord_tbl_ent(dev, i, 0);
__u32 idx = ord_to_idx(ord);
if (!(ord & IMSM_ORD_REBUILD) &&