summaryrefslogtreecommitdiffstats
path: root/Create.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-01-31 01:34:42 +0100
committerNeilBrown <neilb@suse.de>2011-01-31 01:34:42 +0100
commit6946681db03c076897616bd9aae27b127456d8f5 (patch)
treefa5018524df45a9f3fd09c80dbeb95c7c1aa0e41 /Create.c
parentsuper1: fix regression in write_init_super. (diff)
downloadmdadm-6946681db03c076897616bd9aae27b127456d8f5.tar.xz
mdadm-6946681db03c076897616bd9aae27b127456d8f5.zip
Call free_super earlier when creating an array.
As free_super now closes fds for member devices, rather than write_init_super doing it, we need to call free_super earlier, so that the device (on which we hold an O_EXCL open) is closed before it is added to the array. So close at the end of pass-1 rather than after pass-2. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Create.c b/Create.c
index 7c6979ac..a0669fe0 100644
--- a/Create.c
+++ b/Create.c
@@ -823,7 +823,6 @@ int Create(struct supertype *st, char *mddev,
Name ": ADD_NEW_DISK for %s "
"failed: %s\n",
dv->devname, strerror(errno));
- st->ss->free_super(st);
goto abort;
}
break;
@@ -866,10 +865,10 @@ int Create(struct supertype *st, char *mddev,
map_unlock(&map);
flush_metadata_updates(st);
+ st->ss->free_super(st);
}
}
free(infos);
- st->ss->free_super(st);
if (level == LEVEL_CONTAINER) {
/* No need to start. But we should signal udev to