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>
This commit is contained in:
NeilBrown 2011-01-31 11:34:42 +11:00
parent e809000535
commit 6946681db0
1 changed files with 1 additions and 2 deletions

View File

@ -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