1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

lv_manip: avoid removing LV when converting

In some cases we use 'creation' also during conversion.
Here it can be actually unwanted side effect we may remove
not just newly created layers - but also original converted LV.

So until we make clear how to properly revert from some errors
in middle of conversion, disable removal for any 'lvconvert' commands.
This commit is contained in:
Zdenek Kabelac 2021-02-17 11:09:41 +01:00
parent 3ef0861355
commit 096edeee71

View File

@ -8809,7 +8809,9 @@ revert_new_lv:
lockd_free_lv(vg->cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args); lockd_free_lv(vg->cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args);
/* FIXME Better to revert to backup of metadata? */ /* FIXME Better to revert to backup of metadata? */
if (!lv_remove(lv) || !vg_write(vg) || !vg_commit(vg)) /* Do not remove anything for create during conversion operation */
if (!strncmp(cmd->name, "lvconvert", 9) ||
!lv_remove(lv) || !vg_write(vg) || !vg_commit(vg))
log_error("Manual intervention may be required to remove " log_error("Manual intervention may be required to remove "
"abandoned LV(s) before retrying."); "abandoned LV(s) before retrying.");
else else