diff options
-rw-r--r-- | Create.c | 7 | ||||
-rw-r--r-- | super-ddf.c | 1 | ||||
-rw-r--r-- | super-intel.c | 1 | ||||
-rw-r--r-- | super0.c | 1 | ||||
-rw-r--r-- | super1.c | 1 | ||||
-rw-r--r-- | util.c | 3 |
6 files changed, 11 insertions, 3 deletions
@@ -672,7 +672,7 @@ int Create(struct supertype *st, char *mddev, sysfs_init(&info, mdfd, 0); - if (st->ss->external && st->subarray[0]) { + if (st->ss->external && st->container_dev != NoMdDev) { /* member */ /* When creating a member, we need to be careful @@ -775,7 +775,8 @@ int Create(struct supertype *st, char *mddev, if (have_container) fd = -1; else { - if (st->ss->external && st->subarray[0]) + if (st->ss->external && + st->container_dev != NoMdDev) fd = open(dv->devname, O_RDWR); else fd = open(dv->devname, O_RDWR|O_EXCL); @@ -906,7 +907,7 @@ int Create(struct supertype *st, char *mddev, } if (verbose >= 0) fprintf(stderr, Name ": array %s started.\n", mddev); - if (st->ss->external && st->subarray[0]) { + if (st->ss->external && st->container_dev != NoMdDev) { if (need_mdmon) start_mdmon(st->container_dev); diff --git a/super-ddf.c b/super-ddf.c index ab35891..01c376d 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -893,6 +893,7 @@ static struct supertype *match_metadata_desc_ddf(char *arg) st = malloc(sizeof(*st)); memset(st, 0, sizeof(*st)); + st->container_dev = NoMdDev; st->ss = &super_ddf; st->max_devs = 512; st->minor_version = 0; diff --git a/super-intel.c b/super-intel.c index 3c18e57..5470c91 100644 --- a/super-intel.c +++ b/super-intel.c @@ -333,6 +333,7 @@ static struct supertype *match_metadata_desc_imsm(char *arg) if (!st) return NULL; memset(st, 0, sizeof(*st)); + st->container_dev = NoMdDev; st->ss = &super_imsm; st->max_devs = IMSM_MAX_DEVICES; st->minor_version = 0; @@ -917,6 +917,7 @@ static struct supertype *match_metadata_desc0(char *arg) if (!st) return st; memset(st, 0, sizeof(*st)); + st->container_dev = NoMdDev; st->ss = &super0; st->info = NULL; st->minor_version = 90; @@ -1371,6 +1371,7 @@ static struct supertype *match_metadata_desc1(char *arg) if (!st) return st; memset(st, 0, sizeof(*st)); + st->container_dev = NoMdDev; st->ss = &super1; st->max_devs = 384; st->sb = NULL; @@ -1126,6 +1126,9 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type) int i; st = malloc(sizeof(*st)); + memset(st, 0, sizeof(*st)); + st->container_dev = NoMdDev; + for (i=0 ; superlist[i]; i++) { int rv; ss = superlist[i]; |