imsm: fix up compare_super_imsm() to match family_num for populated mpb's

This allows spares to be associated with any family while not allowing
disks from different families to be assembled.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Dan Williams 2008-09-15 20:58:40 -07:00
parent e0783b419d
commit 3e372e5a72
1 changed files with 9 additions and 0 deletions

View File

@ -793,6 +793,15 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst)
return 3;
}
/* if 'first' is a spare promote it to a populated mpb with sec's
* family number
*/
if (first->anchor->num_raid_devs == 0 &&
sec->anchor->num_raid_devs > 0) {
first->anchor->num_raid_devs = sec->anchor->num_raid_devs;
first->anchor->family_num = sec->anchor->family_num;
}
return 0;
}