Skip to contentSkip to conversation

master - lvextend: detect stacked cache lv used for thinpool

PATCH Zdenek Kabelac 1 participant 1 message Oct 23, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d6fcab900b5b33c55c7894c3f4a7cdd1dbb81c1a
Commit:        d6fcab900b5b33c55c7894c3f4a7cdd1dbb81c1a
Parent:        de58df390b6bd3f46841fdacb9a75defccf9f3e2
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Oct 23 11:20:32 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Oct 23 12:00:43 2017 +0200

lvextend: detect stacked cache lv used for thinpool

Ensure, that cacheLV is not tried to be resize until full support is added.

---
 WHATS_NEW               |    1 +
 lib/metadata/lv_manip.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
index 2644d37..2f08468 100644
@@ -1,5 +1,6 @@
 Version 2.02.176 -
 ===================================
+  Avoid internal error when resizing cache type _tdata LV (not yet supported).
   Show original converted names when lvconverting LV to pool volume.
   Move lib code used only by liblvm into metadata-liblvm.c.
   Distinguish between device not found and excluded by filter.
lib/metadata/lv_manip.c +2 -1
index c0e9a99..b03f9cf 100644
@@ -4797,7 +4797,8 @@ static int _lvresize_check(struct logical_volume *lv,
 		return 0;
 	}
 
-	if (lv_is_cache_type(lv)) {
+	if (lv_is_cache_type(lv) ||
+	    (lv_is_thin_pool(lv) && lv_is_cache_type(seg_lv(first_seg(lv), 0)))) {
 		log_error("Unable to resize logical volumes of cache type.");
 		return 0;
 	}