The 'cling' allocation policy is behaving like the 'normal' policy when there is no pre-existing preceding segment to cling to. Example: Use lvcreate with --alloc cling to create a linear device that fits within the VG but is too large to fit on any single PV in the VG. It succeeds, placing the data across multiple PVs. It should fail.
Patch to fix 3 different ways in which 'cling' incorrectly gives an outcome like 'normal': http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=text&tr1=1.375&r2=text&tr2=1.380&f=u
# pvs PV VG Fmt Attr PSize PFree /dev/loop0 vg3 lvm2 a- 96.00m 28.00m /dev/loop1 vg3 lvm2 a- 96.00m 96.00m # lvs LV VG Attr LSize lvol0 vg3 -wi--- 68.00m Before: # lvextend vg3/lvol0 -L +36M --alloc cling Extending logical volume lvol0 to 104.00 MiB Logical volume lvol0 successfully resized After: # lvextend vg3/lvol0 -L +36M --alloc cling Extending logical volume lvol0 to 104.00 MiB Insufficient suitable allocatable extents for logical volume lvol0: 2 more required Same for lvcreate.
Adding QA ack for 6.4. Devel will need to provide unit testing results however before this bug can be ultimately verified by QA.
Tested with both lvcreate and lvextend. Both are failing as expected if the PV size is smaller than the needed size while using --alloc cling. (10:11:03) [root@r6-node01:~]$ lvcreate small_vg -L220M --alloc cling -n big2_lv Insufficient suitable allocatable extents for logical volume big2_lv: 6 more required ------------------------------------------ (10:13:38) [root@r6-node01:~]$ lvs LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lv_root VolGroup -wi-ao-- 6.54g lv_swap VolGroup -wi-ao-- 1.97g big2_lv small_vg -wl-a--- 132.00m (10:13:47) [root@r6-node01:~]$ lvextend small_vg/big2_lv -L +68M Extending logical volume big2_lv to 200.00 MiB Insufficient suitable allocatable extents for logical volume big2_lv: 1 more required 10:14:07) [root@r6-node01:~]$ pvs PV VG Fmt Attr PSize PFree /dev/sda1 small_vg lvm2 a-- 196.00m 64.00m /dev/sdd1 small_vg lvm2 a-- 196.00m 196.00m /dev/sdf1 lvm2 a-- 10.00g 10.00g /dev/sdg1 lvm2 a-- 10.00g 10.00g /dev/vda2 VolGroup lvm2 a-- 8.51g 0 (10:16:56) [root@r6-node01:~]$ lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert Devices lv_root VolGroup -wi-ao-- 6.54g /dev/vda2(0) lv_swap VolGroup -wi-ao-- 1.97g /dev/vda2(1674) big2_lv small_vg -wl-a--- 132.00m /dev/sda1(0)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0501.html