[linux-lvm] [PATCH LVM2] Fix max_parallel calculation

Jun'ichi Nomura j-nomura at ce.jp.nec.com
Tue Aug 29 17:12:25 UTC 2006


Hi,

In _find_parallel_space(), there is 2 mistakes in calculation of
max_parallel (and *allocated).

  1. max_parallel and *allocated are number of extents multiplied by
     ah->area_multiple.
     So it needs to be divided by ah->area_multiple when it's used for
     stripe length calculation
  2. max_parallel specifies the total number of extents, not the newly
     allocated one.
     So it doesn't need to be offset by starting le.

As a result, allocation fails unexpectedly.

Typical failure cases:
  1) lvcreate --alloc contiguous fails for striped LV
     if requested LV size is larger than a PV size
  2) lvconvert -m to add mirror to existing LV fails
     if the existing LV has more than one segments

Attached patch fixes them.
Applicable to 2.02.09.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02-fix-max_parallel-calculation.patch
Type: text/x-patch
Size: 2479 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20060829/e8cb198c/attachment.bin>


More information about the linux-lvm mailing list