mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
cleanup: deactivate has builtin check for active lv
This commit is contained in:
parent
74923c213f
commit
c621bc3d36
@ -1523,10 +1523,9 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
|
|||||||
MIRROR_BY_LV)) {
|
MIRROR_BY_LV)) {
|
||||||
layer_lv = seg_lv(first_seg(lv), 0);
|
layer_lv = seg_lv(first_seg(lv), 0);
|
||||||
if (!remove_layer_from_lv(lv, layer_lv) ||
|
if (!remove_layer_from_lv(lv, layer_lv) ||
|
||||||
(lv_is_active(layer_lv) &&
|
!deactivate_lv(cmd, layer_lv) ||
|
||||||
!deactivate_lv(cmd, layer_lv)) ||
|
!lv_remove(layer_lv) ||
|
||||||
!lv_remove(layer_lv) || !vg_write(lv->vg) ||
|
!vg_write(lv->vg) || !vg_commit(lv->vg)) {
|
||||||
!vg_commit(lv->vg)) {
|
|
||||||
log_error("ABORTING: Failed to remove "
|
log_error("ABORTING: Failed to remove "
|
||||||
"temporary mirror layer %s.",
|
"temporary mirror layer %s.",
|
||||||
display_lvname(layer_lv));
|
display_lvname(layer_lv));
|
||||||
|
Loading…
Reference in New Issue
Block a user