]> sourceware.org Git - lvm2.git/commitdiff
snapshot: Don't deactivate fictional snapshot LV.
authorAlasdair G Kergon <agk@redhat.com>
Thu, 14 Apr 2016 19:48:28 +0000 (20:48 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 14 Apr 2016 21:32:26 +0000 (22:32 +0100)
Commit 971ab733b74e0ffecc3f9f60af48628cd3fba1db ("thin: activation of
merging thin snapshot") also added an incorrect deactivation attempt
for non-thin LVs: find_snapshot(lv)->lv is not designed to be
activated and any attempt to deactivate it is incorrect.

WHATS_NEW
tools/toollib.c

index f4eb6ad5f950ef5ea95378f08e5de021f634ff26..69ced16dbed7933cf77ed56a8b139b738a598f8b 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
-Version 2.02.151
+Version 2.02.151 -
 =================================
+  Don't try deactivating fictional internal LV before snapshot merge. (2.02.105)
   When not obtaining devs from udev, check they exist before caching them.
   Detect device mismatch also when compiling without udev support.
 
index ce49773804e0f692f054f70c64f928712c468402..b1225cd679ae524c0117d28c03d143985f69ee43 100644 (file)
@@ -1022,6 +1022,7 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
                       activation_change_t activate)
 {
        int r = 1;
+       struct logical_volume *snapshot_lv;
 
        if (lv_is_cache_pool(lv)) {
                if (is_change_activating(activate)) {
@@ -1053,7 +1054,8 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
                 * User could retry to deactivate it with another
                 * deactivation of origin, which is the only visible LV
                 */
-               if (!deactivate_lv(cmd, find_snapshot(lv)->lv)) {
+               snapshot_lv = find_snapshot(lv)->lv;
+               if (lv_is_thin_type(snapshot_lv) && !deactivate_lv(cmd, snapshot_lv)) {
                        if (is_change_activating(activate)) {
                                log_error("Refusing to activate merging \"%s\" while snapshot \"%s\" is still active.",
                                          lv->name, find_snapshot(lv)->lv->name);
This page took 0.058991 seconds and 5 git commands to generate.