summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-07-31 17:08:22 -0700
committerDan Williams <dan.j.williams@intel.com>2009-07-31 17:08:22 -0700
commitaf99d9ca67a4dc898e7be1d4a947800deec93c83 (patch)
treef5335e0be64ab1bf9004d641ae21a7acb60be80d /super-intel.c
parentfa09d4961e5c72da3c7f78d53a7d64f5196110a3 (diff)
downloadmdadm-af99d9ca67a4dc898e7be1d4a947800deec93c83.tar.gz
mdadm-af99d9ca67a4dc898e7be1d4a947800deec93c83.tar.xz
mdadm-af99d9ca67a4dc898e7be1d4a947800deec93c83.zip
teach imsm and ddf what st->subarray means at load_super time
RebuildMap wants to poll through mdstat and retrieve a (kernel name, uuid, user name) tuple for each array. Teach imsm and ddf to honor st->sub_array at ->load_super() time to set their internal subarray pointers to the value specified in st->subarray, or return an error if st->subarray specifies an invalid array. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/super-intel.c b/super-intel.c
index 3abaca5..24827d0 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -2167,8 +2167,10 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp,
if (st->subarray[0]) {
if (atoi(st->subarray) <= super->anchor->num_raid_devs)
super->current_vol = atoi(st->subarray);
- else
+ else {
+ free_imsm(super);
return 1;
+ }
}
*sbp = super;
@@ -2193,8 +2195,6 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname)
if (load_super_imsm_all(st, fd, &st->sb, devname, 1) == 0)
return 0;
#endif
- if (st->subarray[0])
- return 1; /* FIXME */
super = alloc_super(0);
if (!super) {
@@ -2215,6 +2215,15 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname)
return rv;
}
+ if (st->subarray[0]) {
+ if (atoi(st->subarray) <= super->anchor->num_raid_devs)
+ super->current_vol = atoi(st->subarray);
+ else {
+ free_imsm(super);
+ return 1;
+ }
+ }
+
st->sb = super;
if (st->ss == NULL) {
st->ss = &super_imsm;