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

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



Jun'ichi Nomura wrote:
> 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.

The patch was incomplete.
The same change is needed for log-only addition/removal.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
Index: LVM2.work/tools/lvconvert.c
===================================================================
--- LVM2.work.orig/tools/lvconvert.c
+++ LVM2.work/tools/lvconvert.c
@@ -509,7 +509,7 @@ static int lvconvert_mirrors(struct cmd_
 
 	if (lp->mirrors == existing_mirrors) {
 		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,
@@ -517,7 +517,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]