From 13dc67cda7e9a50817826e460f1b04be8abe3167 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 4 Nov 2011 01:31:23 +0000 Subject: [PATCH] Add missing lvrename mirrored log recursion in for_each_sub_lv. --- WHATS_NEW | 1 + lib/metadata/lv_manip.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index dc47f27c9..7675936e3 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Add missing lvrename mirrored log recursion in for_each_sub_lv. Improve lv_extend stack reporting. Increase virtual segment size instead of creating multiple segment list. Add last_seg(lv) internal function. diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 831e0c765..f76d1db6d 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -2749,13 +2749,20 @@ int for_each_sub_lv(struct cmd_context *cmd, struct logical_volume *lv, struct lv_segment *seg; uint32_t s; - if (lv_is_cow(lv) && lv_is_virtual_origin(org = origin_from_cow(lv))) + if (lv_is_cow(lv) && lv_is_virtual_origin(org = origin_from_cow(lv))) { if (!fn(cmd, org, data)) return_0; + if (!for_each_sub_lv(cmd, org, fn, data)) + return_0; + } dm_list_iterate_items(seg, &lv->segments) { - if (seg->log_lv && !fn(cmd, seg->log_lv, data)) - return_0; + if (seg->log_lv) { + if (!fn(cmd, seg->log_lv, data)) + return_0; + if (!for_each_sub_lv(cmd, seg->log_lv, fn, data)) + return_0; + } if (seg->pool_metadata_lv && !fn(cmd, seg->pool_metadata_lv, data)) return_0; for (s = 0; s < seg->area_count; s++) {