]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-intel.c
imsm: fix up compare_super_imsm() to match family_num for populated mpb's
[thirdparty/mdadm.git] / 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;
 }