From 2aee4769b43a08eed549bd324664af5f406a25b2 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 22 Dec 2016 19:46:02 +0100 Subject: [PATCH] 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. --- WHATS_NEW | 1 + tools/lvconvert.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 8fefe6ade..dcfd85aca 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -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) -- 2.43.5