]> sourceware.org Git - lvm2.git/commitdiff
cache: improve vgremove loop
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 26 Aug 2019 11:28:00 +0000 (13:28 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 26 Aug 2019 13:32:12 +0000 (15:32 +0200)
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.

WHATS_NEW
lib/metadata/lv_manip.c

index 0b48e032b05e6fd25e5930f3cda106385db3f0b9..cb93bbef15114f727d5a4a4e34df650aeddb4b73 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.03.06 - 
 ================================
+  Improve internal removal of cached devices.
   Synchronize with udev when dropping snapshot.
   Add missing device synchronization point before removing pvmove node.
   Correctly set read_ahead for LVs when pvmove is finished.
index 6aee947b97f5c6e63439ceeb67d52365c045417d..af3a16fe2d214bc36e190e6583dd3f0ffede3569 100644 (file)
@@ -6544,6 +6544,13 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
                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) &&
            !_lv_remove_segs_using_this_lv(cmd, lv, force, level, "external origin"))
                return_0;
This page took 0.063194 seconds and 5 git commands to generate.