From: Zdenek Kabelac Date: Thu, 26 Jan 2012 21:39:32 +0000 (+0000) Subject: Thin for_each_sub_lv X-Git-Tag: v2_02_91~66 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=7012268499edbca8f04fcf3b672286ddadc293d9;p=lvm2.git Thin for_each_sub_lv Adapt to scan thin dependency LVs --- diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 400e446bf..19f3231ba 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. - * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved. * * This file is part of LVM2. * @@ -2784,8 +2784,21 @@ int for_each_sub_lv(struct cmd_context *cmd, struct logical_volume *lv, if (!for_each_sub_lv(cmd, seg->log_lv, fn, data)) return_0; } - if (seg->metadata_lv && !fn(cmd, seg->metadata_lv, data)) - return_0; + + if (seg->pool_lv) { + if (!fn(cmd, seg->pool_lv, data)) + return_0; + if (!for_each_sub_lv(cmd, seg->pool_lv, fn, data)) + return_0; + } + + if (seg->metadata_lv) { + if (!fn(cmd, seg->metadata_lv, data)) + return_0; + if (!for_each_sub_lv(cmd, seg->metadata_lv, fn, data)) + return_0; + } + for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_LV) continue;