From b2b18a5f8b4f6c5b116655f7e9e7c102462f693f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 6 Oct 2014 13:15:31 +0200 Subject: [PATCH] lvconvert more test for thin external origin Some LV types were not properly disallowed to be used as external origin. --- WHATS_NEW | 1 + tools/lvconvert.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 5fc42d669..6b768eab8 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.112 - ===================================== + Fix detection of unsupported thin external lvconversions. Fix detection of unsupported cache and thin pool lvconversions. Fix detection of unsupported lvconversion of cache to snapshot. Improve code for creation of cache and cache pool volumes. diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 36fafbeaf..070c5e465 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -2664,8 +2664,13 @@ static int _lvconvert_thin(struct cmd_context *cmd, return 0; } - if (lv_is_pool(lv)) { - log_error("Can't use pool %s as external origin.", + if (lv_is_cache_type(lv) || + lv_is_cow(lv) || + lv_is_pool(lv) || + lv_is_thin_pool_data(lv) || + lv_is_thin_pool_metadata(lv)) { + log_error("Can't use %s %s as external origin.", + first_seg(lv)->segtype->name, display_lvname(lv)); return 0; } -- 2.43.5