Create: add error checking for 'write_init_super'.

If this fails, we really must fail the whole 'create'.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-05-11 13:43:27 +10:00
parent e9b11feec8
commit ab80e597ba
1 changed files with 7 additions and 1 deletions

View File

@ -890,7 +890,13 @@ int Create(struct supertype *st, char *mddev,
me = map_by_devnum(&map, st->container_dev);
}
st->ss->write_init_super(st);
if (st->ss->write_init_super(st)) {
fprintf(stderr,
Name ": Failed to write metadata to %s\n",
dv->devname);
st->ss->free_super(st);
goto abort;
}
/* update parent container uuid */
if (me) {