diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-22 19:46:02 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-12-22 23:37:07 +0100 |
commit | 2aee4769b43a08eed549bd324664af5f406a25b2 (patch) | |
tree | 7d9d3568d2ad41b7fabf16a3ea5ee9048194f807 | |
parent | 95e3dd5fb1297f6b1aa23cbedad1ab3dc14343a7 (diff) | |
download | lvm2-2aee4769b43a08eed549bd324664af5f406a25b2.tar.gz |
snapshot: validate merge has started
Before starting polling process, validate the merge has actually started
so there is not pointless invoke of lvmpolld.
This also fixes reported message from command, so user has
correct info whether merging has already started or
if it's delayed for next activation.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | tools/lvconvert.c | 9 |
2 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,6 @@ Version 2.02.169 - ===================================== + Detect if snapshot merge really started before polling for progress. Checking LV for merging origin requires also it has merged snapshot. Extend validation of metadata processing. Enable usage of cached volumes as snapshot origin LV. diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 0f0f0addb..ba8396f9a 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -2497,8 +2497,13 @@ static int _lvconvert_merge_old_snapshot(struct cmd_context *cmd, if (!lv_update_and_reload(origin)) return_0; - lp->need_polling = 1; - lp->lv_to_poll = origin; + if (lv_has_target_type(origin->vg->vgmem, origin, NULL, + TARGET_NAME_SNAPSHOT_MERGE)) { + lp->need_polling = 1; + lp->lv_to_poll = origin; + } else + /* Race during table reload prevented merging */ + merge_on_activate = 1; } if (merge_on_activate) |