Skip to contentSkip to conversation

master - cache: support stacked rename

PATCH Zdenek Kabelac 1 participant 1 message Dec 10, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bf4b74c5eb55cdb77c8a7e7e697fb2d43b39c718
Commit:        bf4b74c5eb55cdb77c8a7e7e697fb2d43b39c718
Parent:        dcb26b5f136ad861356d5c118921a254cae2cab4
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Dec 7 13:53:00 2015 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Thu Dec 10 21:01:24 2015 +0100

cache: support stacked rename

Preserve skip_pool flag when running for_each_sub_lv() so lvrename continues to work when thin-pool is using cached data LV.

---
 lib/metadata/lv_manip.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
lib/metadata/lv_manip.c +6 -6
index 2f37f5b..6a93a76 100644
@@ -4154,7 +4154,7 @@ static int _for_each_sub_lv(struct logical_volume *lv, int skip_pools,
 	if (lv_is_cow(lv) && lv_is_virtual_origin(org = origin_from_cow(lv))) {
 		if (!fn(org, data))
 			return_0;
-		if (!for_each_sub_lv(org, fn, data))
+		if (!_for_each_sub_lv(org, skip_pools, fn, data))
 			return_0;
 	}
 
@@ -4162,21 +4162,21 @@ static int _for_each_sub_lv(struct logical_volume *lv, int skip_pools,
 		if (seg->log_lv) {
 			if (!fn(seg->log_lv, data))
 				return_0;
-			if (!for_each_sub_lv(seg->log_lv, fn, data))
+			if (!_for_each_sub_lv(seg->log_lv, skip_pools, fn, data))
 				return_0;
 		}
 
 		if (seg->metadata_lv) {
 			if (!fn(seg->metadata_lv, data))
 				return_0;
-			if (!for_each_sub_lv(seg->metadata_lv, fn, data))
+			if (!_for_each_sub_lv(seg->metadata_lv, skip_pools, fn, data))
 				return_0;
 		}
 
 		if (seg->pool_lv && !skip_pools) {
 			if (!fn(seg->pool_lv, data))
 				return_0;
-			if (!for_each_sub_lv(seg->pool_lv, fn, data))
+			if (!_for_each_sub_lv(seg->pool_lv, skip_pools, fn, data))
 				return_0;
 		}
 
@@ -4185,7 +4185,7 @@ static int _for_each_sub_lv(struct logical_volume *lv, int skip_pools,
 				continue;
 			if (!fn(seg_lv(seg, s), data))
 				return_0;
-			if (!for_each_sub_lv(seg_lv(seg, s), fn, data))
+			if (!_for_each_sub_lv(seg_lv(seg, s), skip_pools, fn, data))
 				return_0;
 		}
 
@@ -4198,7 +4198,7 @@ static int _for_each_sub_lv(struct logical_volume *lv, int skip_pools,
 				continue;
 			if (!fn(seg_metalv(seg, s), data))
 				return_0;
-			if (!for_each_sub_lv(seg_metalv(seg, s), fn, data))
+			if (!_for_each_sub_lv(seg_metalv(seg, s), skip_pools, fn, data))
 				return_0;
 		}
 	}