[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 11/11] Fix _remove_mirror_images() to skip AREA_LV



Do not remove mirror image on AREA_LV.

If the mirror image LV consists of AREA_LV, current version
of remove_mirror_images() always remove it ignoring removable_pvs
constraint.
That's not correct.

The FIXME comment suggests recursing down the AREA_LV.
However, it might not be sufficient if we can have LVs with
different structure.

Currently, we won't hit this check.
So just leave it for safety side.

-- 
Jun'ichi Nomura, NEC Corporation of America
Do not remove mirror image on AREA_LV.

If the mirror image LV consists of AREA_LV, current version
of remove_mirror_images() always remove it ignoring removable_pvs
constraint.
That's not correct.

The FIXME comment suggests recursing down the AREA_LV.
However, it might not be sufficient if we can have LVs with different
structure.

Currently, we won't hit this check.
So just leave it for safety side.

Index: LVM2.work/lib/metadata/mirror.c
===================================================================
--- LVM2.work.orig/lib/metadata/mirror.c
+++ LVM2.work/lib/metadata/mirror.c
@@ -357,9 +357,12 @@ static int _is_mirror_image_removable(st
 
 	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);
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]