]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: fix up compare_super_imsm() to match family_num for populated mpb's
authorDan Williams <dan.j.williams@intel.com>
Tue, 16 Sep 2008 03:58:40 +0000 (20:58 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 16 Sep 2008 03:58:40 +0000 (20:58 -0700)
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>
super-intel.c

index b4bcb283aad9668e0efc8df358d9d136fee695c6..f1b243579ea35eceef972db8bc99bb08522db10b 100644 (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;
 }