From 1cb07e9cfd235c4345db304338f09824ab97321e Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 16 Jan 2008 19:38:39 +0000 Subject: [PATCH] cope with stacked LVs as well as PVs when deciding which bits of mirrors to remove --- lib/metadata/mirror.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 21e00b945..f4793c7a1 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -347,9 +347,12 @@ static int _is_mirror_image_removable(struct logical_volume *mimage_lv, list_iterate_items(seg, &mimage_lv->segments) { for (s = 0; s < seg->area_count; s++) { - if (seg_type(seg, s) != AREA_PV) - /* FIXME Recurse for AREA_LV */ - continue; + if (seg_type(seg, s) != AREA_PV) { + /* FIXME Recurse for AREA_LV? */ + /* Structure of seg_lv is unknown. + * Not removing this LV for safety. */ + return 0; + } pv = seg_pv(seg, s);