From 435c82f8f6312758e1d198d4cb0a2158b7a51bac Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 16 Jun 2014 13:38:35 +0200 Subject: [PATCH] snapshot: check it's still snapshot While polling for snapshot, detect first the snapshot still exits. It's valid to have multiple polling threads watching for the same thing and just 1 can 'win' the finish part. All others should nicely 'fail'. --- tools/lvconvert.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 82ce360f3..731d4c812 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -801,7 +801,8 @@ static progress_t _poll_merge_progress(struct cmd_context *cmd, { percent_t percent = PERCENT_0; - if (!lv_snapshot_percent(lv, &percent)) { + if (!lv_is_merging_origin(lv) || + !lv_snapshot_percent(lv, &percent)) { log_error("%s: Failed query for merging percentage. Aborting merge.", lv->name); return PROGRESS_CHECK_FAILED; } else if (percent == PERCENT_INVALID) {