[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-lvm
Subject:    [linux-lvm] [PATCH LVM2] Fix _for_each_pv() to return correct
From:       "Jun'ichi Nomura" <j-nomura () ce ! jp ! nec ! com>
Date:       2006-08-29 17:12:21
Message-ID: 44F47575.6090006 () ce ! jp ! nec ! com
[Download RAW message or body]

Hi,

_for_each_pv() is a function to walk through all PVs used by
given part of LV. The function is expected to set smallest length
of PV segment consists of the part of LV.
However, current code doesn't work as expected.

As a result, build_parallel_areas_from_lv() considers only the
first segment of the LV and fails to build appropriate list of
PVs to be avoided.

Attached patch fixes this problem.
Applicable to 2.02.09.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America



["01-fix-for_each_pv-to-return-correct-segment-end.patch" (text/x-patch)]

_for_each_pv() is a function to walk through all PVs used by
given part of LV. The function is expected to set smallest length
of PV segment consists of the part of LV.
However, current code doesn't work as expected.

As a result, build_parallel_areas_from_lv() considers only the
first segment of the LV and fails to build appropriate list of
PVs to be avoided.

diff -urp LVM2.00/lib/metadata/lv_manip.c LVM2.01/lib/metadata/lv_manip.c
--- LVM2.00/lib/metadata/lv_manip.c	2006-08-25 03:50:56.000000000 -0400
+++ LVM2.01/lib/metadata/lv_manip.c	2006-08-26 00:06:29.000000000 -0400
@@ -1358,7 +1358,7 @@ static int _for_each_pv(struct cmd_conte
 	/* Remaining logical length of segment */
 	remaining_seg_len = seg->len - (le - seg->le);
 
-	if (len > remaining_seg_len)
+	if (remaining_seg_len > len)
 		remaining_seg_len = len;
 
 	if (spvs->len > remaining_seg_len)


_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic