diff options
author | Alasdair G Kergon <agk@redhat.com> | 2016-04-14 20:48:28 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2016-04-14 22:32:26 +0100 |
commit | f0179fac315b630aa4c475d2441dd3b5b12f0c6d (patch) | |
tree | 0d1d9868f797454c13a9e6a474536f40e5157291 | |
parent | c68fb55ac104079e4708d9b869ef8edd9d1202c4 (diff) | |
download | lvm2-f0179fac315b630aa4c475d2441dd3b5b12f0c6d.tar.gz |
snapshot: Don't deactivate fictional snapshot LV.
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.
-rw-r--r-- | WHATS_NEW | 3 | ||||
-rw-r--r-- | tools/toollib.c | 4 |
2 files changed, 5 insertions, 2 deletions
@@ -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. diff --git a/tools/toollib.c b/tools/toollib.c index ce4977380..b1225cd67 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -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); |