1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

cache: improve vgremove loop

Support internal removal of 'cache origin' volume - which we
do not normally expose to a user - however internal processing
loops may hit this condition (depending on order of list LVs).

So when this operation is internally requested - we automatically
try to remove it's 'holding' LV (cache LV) - which will also
remove the origin.
This commit is contained in:
Zdenek Kabelac 2019-08-26 13:28:00 +02:00
parent af0b84ccc8
commit c98e34e4d0
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.03.06 - Version 2.03.06 -
================================ ================================
Improve internal removal of cached devices.
Synchronize with udev when dropping snapshot. Synchronize with udev when dropping snapshot.
Add missing device synchronization point before removing pvmove node. Add missing device synchronization point before removing pvmove node.
Correctly set read_ahead for LVs when pvmove is finished. Correctly set read_ahead for LVs when pvmove is finished.

View File

@ -6544,6 +6544,13 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
return 0; return 0;
} }
if (lv_is_cache_origin(lv)) {
if (!_lv_remove_segs_using_this_lv(cmd, lv, force, level, "cache origin"))
return_0;
/* Removal of cache LV also removes caching origin */
return 1;
}
if (lv_is_external_origin(lv) && if (lv_is_external_origin(lv) &&
!_lv_remove_segs_using_this_lv(cmd, lv, force, level, "external origin")) !_lv_remove_segs_using_this_lv(cmd, lv, force, level, "external origin"))
return_0; return_0;