From bf4b74c5eb55cdb77c8a7e7e697fb2d43b39c718 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 7 Dec 2015 13:53:00 +0100 Subject: [PATCH] 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 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 2f37f5b19..6a93a76f2 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -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; } }