1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

thin: remove stack external origins

Ensure external origin is deactivated during removal.
Only unused external origins can be deactivated.
This commit is contained in:
Zdenek Kabelac 2024-03-04 11:58:32 +01:00
parent 3bd9f936da
commit a0776fe409

View File

@ -7932,9 +7932,18 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
return 1;
}
if (lv_is_external_origin(lv) &&
!_lv_remove_segs_using_this_lv(cmd, lv, force, level, "external origin"))
return_0;
if (lv_is_external_origin(lv)) {
if (!_lv_remove_check_in_use(lv, force))
return_0;
if (!deactivate_lv(cmd, lv))
goto no_remove;
log_verbose("Removing external origin logical volume %s.", display_lvname(lv));
if (!_lv_remove_segs_using_this_lv(cmd, lv, force, level, "external origin"))
return_0;
}
if (lv_is_used_thin_pool(lv) &&
!_lv_remove_segs_using_this_lv(cmd, lv, force, level, "pool"))