[linux-lvm] [PATCH] Fix lvextend spoiling redundancy of mirror LV

Jun'ichi Nomura j-nomura at ce.jp.nec.com
Wed Aug 23 21:52:45 UTC 2006


Hi,

lvextend doesn't allocate extents appropriately if the LV is mirrored.
Attached patch fixes the problem.
If this looks reasonable, please consider to include in LVM2.

Details of the problem:

Suppose I have 4 PVs with sufficient free space and a 2-sided
mirrored LV with size=4MB, I would expect the following LV
as a result of "lvextend -L+4MB":

# lvs -a -olv_name,seg_size,devices vg4
  LV             SSize Devices
  lv0            8.00M lv0_mimage_0(0),lv0_mimage_1(0)
  [lv0_mimage_0] 8.00M /dev/sda(0)
  [lv0_mimage_1] 8.00M /dev/sdb(0)
  [lv0_mlog]     4.00M /dev/sdc(0)

However, actual result was following:

# lvs -a -olv_name,seg_size,devices vg4
  LV             SSize Devices
  lv0            8.00M lv0_mimage_0(0),lv0_mimage_1(0)
  [lv0_mimage_0] 4.00M /dev/sda(0)
  [lv0_mimage_0] 4.00M /dev/sdd(0)
  [lv0_mimage_1] 4.00M /dev/sdb(0)
  [lv0_mimage_1] 4.00M /dev/sda(1)
  [lv0_mlog]     4.00M /dev/sdc(0)

In this case, failure of a PV (/dev/sda) would break whole LV (lv0),
which is not what we expect from mirrored LV.

The cause of the problem is that _check_contiguous() doesn't care
layered LV and cannot find out contiguousness between PV areas.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-lvextend-spoiling-redundancy.patch
Type: text/x-patch
Size: 1640 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20060823/fd4a54c5/attachment.bin>


More information about the linux-lvm mailing list