From: Dan Williams Date: Tue, 16 Sep 2008 03:58:40 +0000 (-0700) Subject: imsm: fix up compare_super_imsm() to match family_num for populated mpb's X-Git-Tag: mdadm-3.0-devel1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e372e5a7299d1f969c02b4ecf10b7df0998926d;p=thirdparty%2Fmdadm.git 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 --- diff --git a/super-intel.c b/super-intel.c index b4bcb283..f1b24357 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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; }