The superblock is kept if adding new device fails. It should clear the
superblock if it fails to add a new disk.
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
int j;
mdu_disk_info_t disc;
struct map_ent *map = NULL;
+ bool add_new_super = false;
if (!get_dev_size(tfd, dv->devname, &ldsize)) {
if (dv->disposition == 'M')
goto unlock;
if (tst->ss->write_init_super(tst))
goto unlock;
+ add_new_super = true;
} else if (dv->disposition == 'A') {
/* this had better be raid1.
* As we are "--re-add"ing we must find a spare slot
map_unlock(&map);
return 1;
unlock:
+ if (add_new_super)
+ Kill(dv->devname, tst, 0, -1, 0);
map_unlock(&map);
return -1;
}