diff options
author | NeilBrown <neilb@suse.de> | 2011-01-31 01:34:42 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-01-31 01:34:42 +0100 |
commit | 6946681db03c076897616bd9aae27b127456d8f5 (patch) | |
tree | fa5018524df45a9f3fd09c80dbeb95c7c1aa0e41 /Create.c | |
parent | super1: fix regression in write_init_super. (diff) | |
download | mdadm-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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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 |