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

[lvm-devel] [PATCH 13/14] lvconvert should check first_seg(original_lv)



Jun'ichi Nomura wrote:
> If mirror log addition/removal was requested during conversion,
> lvconvert should manipulate on the original LV, not the top-level LV.

[13/14] lvconvert should check first_seg(original_lv)
          lvconvert tries to add/remove log for the original LV.
          So it should check the original LV's segment for
          the current log type.
          However, it checks the existing of the log for the
          top-level LV.

-- 
Jun'ichi Nomura, NEC Corporation of America
lvconvert searches for the original LV and use it for
log addition/removal.
However, as it checks seg->log_lv, which is for the top-level LV,
it makes wrong decision on what to do.

Index: LVM2.work/tools/lvconvert.c
===================================================================
--- LVM2.work.orig/tools/lvconvert.c
+++ LVM2.work/tools/lvconvert.c
@@ -534,7 +534,7 @@ static int lvconvert_mirrors(struct cmd_
 		 * linear-to-mirror conversion.
 		 */
 		original_lv = _original_lv(lv);
-		if (!seg->log_lv && !corelog) {
+		if (!first_seg(original_lv)->log_lv && !corelog) {
 			if (!add_mirror_log(cmd, original_lv, 1,
 					    adjusted_mirror_region_size(
 							lv->vg->extent_size,
@@ -542,7 +542,7 @@ static int lvconvert_mirrors(struct cmd_
 							lp->region_size),
 					    lp->pvh, lp->alloc))
 				return_0;
-		} else if (seg->log_lv && corelog) {
+		} else if (first_seg(original_lv)->log_lv && corelog) {
 			if (!remove_mirror_log(cmd, original_lv,
 					       lp->pv_count ? lp->pvh : NULL))
 				return_0;

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