mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
pvmove: don't crash when name is not found
If the device name is not found in our metadata, we cannot call strdup few lines later with NULL name. More intersting story goes behind how it happens - pvmove removal is unfortunatelly 'multi-state' process and at some point (for now) we have in lvm2 metadata LV pvmove0 as stripe and mirror image as error. If such metadata are left - we fail with any further removal.
This commit is contained in:
parent
c88ffbf9df
commit
4f94669eca
@ -223,6 +223,12 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
|
||||
if (!name && !parms->aborting)
|
||||
continue;
|
||||
|
||||
if (!name) {
|
||||
log_error("Device name for LV %s not found in metadata. "
|
||||
"(unfinished pvmove mirror removal?)", display_lvname(lv));
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* FIXME Need to do the activation from _set_up_pvmove here
|
||||
* if it's not running and we're not aborting. */
|
||||
if (!lv_is_active(lv)) {
|
||||
|
Loading…
Reference in New Issue
Block a user