summaryrefslogtreecommitdiff
path: root/Create.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-07-12 20:27:38 +1000
committerNeil Brown <neilb@suse.de>2008-07-12 20:27:38 +1000
commitf7e7067b47d2ca9994f9222dfa5833ac84ce3b22 (patch)
tree9519e435af3001dd2ccb2ee01d114067213aa615 /Create.c
parent6adfd3affda071d1083497d150a1150ade0e3fdb (diff)
Add subarray field to supertype.
When loading the metadata for a subarray (super_by_fd), we set ->subarray to be the name read from md/metadata_version so that getinfo_super can return info about the correct array. With this we can differentiate between a container and an array within the container by looking at ->subarray[0].
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Create.c b/Create.c
index eb67968b..495cf39a 100644
--- a/Create.c
+++ b/Create.c
@@ -550,7 +550,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
char ver[100];
strcat(strcpy(ver, "external:"),
info.text_version);
- if (st->ss->external == 2) {
+ if (st->ss->external && st->subarray[0]) {
/* member */
/* When creating a member, we need to be careful
@@ -651,7 +651,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
strcasecmp(dv->devname, "missing")==0)
continue;
- if (st->ss->external == 2)
+ if (st->ss->external && st->subarray[0])
fd = open(dv->devname, O_RDWR, 0);
else
fd = open(dv->devname, O_RDWR|O_EXCL,0);
@@ -732,7 +732,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
}
if (verbose >= 0)
fprintf(stderr, Name ": array %s started.\n", mddev);
- if (st->ss->external == 2) {
+ if (st->ss->external && st->subarray[0]) {
if (need_mdmon) {
int dn = st->container_dev;
int i;