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

[lvm-devel] [PATCH 12/14] Do not make extra call to lv_add_user_seg()



Jun'ichi Nomura wrote:
> As a part of LV stacking support, this patch
> adds a upward link from underlying LV to LV segments
> using the LV.

I'm very sorry. There were some bugs sneaked in the patchst
and I missed them by running tests on unclean tree.

I'm posting 3 additional patches.
[12/14] Do not make extra call to lv_add_user_seg()
[13/14] lvconvert should check first_seg(original_lv)
[14/14] lvconvert help message wasn't fixed to '--wait'

This patch is:

[12/14] Do not make extra call to lv_add_user_seg()
          Without this, lv->segs_using_this_lv will have
          duplicated entry and find_mirror_seg() will fail.
          VG validator will detect it and so most commands
          will not work.

-- 
Jun'ichi Nomura, NEC Corporation of America
fixup_imported_mirrors() does fixup to internal data structure
after reading VG metadata.

Since lv_add_user_seg() for mimage LVs are done in text_import_areas
through set_lv_segment_area_lv(), there's no need for the fixup.
Calling extra lv_add_user_seg() will cause unintended duplication
in segs_using_this_lv list.
VG validator will detect it and report metadata corruption.

Index: LVM2.work/lib/metadata/mirror.c
===================================================================
--- LVM2.work.orig/lib/metadata/mirror.c
+++ LVM2.work/lib/metadata/mirror.c
@@ -1058,10 +1058,6 @@ int fixup_imported_mirrors(struct volume
 
 			if (seg->log_lv && !lv_add_user_seg(seg->log_lv, seg))
 				return_0;
-			for (s = 0; s < seg->area_count; s++)
-				if (seg_type(seg, s) == AREA_LV)
-					if (!lv_add_user_seg(seg_lv(seg, s), seg))
-						return_0;
 		}
 	}
 

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