All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH LVM2] Fix _for_each_pv() to return correct segment end
@ 2006-08-29 17:12 Jun'ichi Nomura
  0 siblings, 0 replies; only message in thread
From: Jun'ichi Nomura @ 2006-08-29 17:12 UTC (permalink / raw)
  To: linux-lvm, Alasdair Kergon, Jonathan Brassow

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

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



[-- Attachment #2: 01-fix-for_each_pv-to-return-correct-segment-end.patch --]
[-- Type: text/x-patch, Size: 869 bytes --]

_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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-29 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-29 17:12 [linux-lvm] [PATCH LVM2] Fix _for_each_pv() to return correct segment end Jun'ichi Nomura

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.