Skip to contentSkip to conversation

master - thin: no pool can be used for external origins

PATCH Zdenek Kabelac 1 participant 1 message Sep 24, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cd3345a5b06ee1626101619f94b346a77295ca03
Commit:        cd3345a5b06ee1626101619f94b346a77295ca03
Parent:        a84d0d0c7b843168516a940a8bc4debafc5f980c
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Sep 22 14:09:55 2014 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Sep 24 10:52:02 2014 +0200

thin: no pool can be used for external origins

Cache pool can't be external origin either.
For simplicity use vg from passed LV.

---
 WHATS_NEW         |    1 +
 tools/lvconvert.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
index 39282c2..a94edc6 100644
@@ -1,5 +1,6 @@
 Version 2.02.112 - 
 =====================================
+  Pools cannot be used as external origin.
   Use lv_update_and_reload() for snapshot reload.
   Don't print message in adjusted_mirror_region_size() in activation.
   Improve lv_update_and_reload() to find out proper lock holding LV.
tools/lvconvert.c +2 -2
index e501978..62e560c 100644
@@ -2511,7 +2511,7 @@ static int _lvconvert_thin(struct cmd_context *cmd,
 			   struct lvconvert_params *lp)
 {
 	struct logical_volume *torigin_lv, *pool_lv = lp->pool_data_lv;
-	struct volume_group *vg = pool_lv->vg;
+	struct volume_group *vg = lv->vg;
 	struct lvcreate_params lvc = {
 		.activate = CHANGE_AEY,
 		.alloc = ALLOC_INHERIT,
@@ -2533,7 +2533,7 @@ static int _lvconvert_thin(struct cmd_context *cmd,
 		return 0;
 	}
 
-	if (lv_is_thin_pool(lv)) {
+	if (lv_is_pool(lv)) {
 		log_error("Can't use pool %s as external origin.",
 			  display_lvname(lv));
 		return 0;