summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-09-15 20:58:40 -0700
committerDan Williams <dan.j.williams@intel.com>2008-09-15 20:58:40 -0700
commit3e372e5a7299d1f969c02b4ecf10b7df0998926d (patch)
treef87798cf3a81126647711b2068bc1595ec13fc42 /super-intel.c
parente0783b419d674815e548960167dd02952900c4a6 (diff)
downloadmdadm-3e372e5a7299d1f969c02b4ecf10b7df0998926d.tar.gz
mdadm-3e372e5a7299d1f969c02b4ecf10b7df0998926d.tar.xz
mdadm-3e372e5a7299d1f969c02b4ecf10b7df0998926d.zip
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>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c
index b4bcb28..f1b2435 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;
}