From 1f1675b059d65768524398791b2e505b7dfe2497 Mon Sep 17 00:00:00 2001 From: Jonathan Brassow Date: Sat, 21 Jun 2014 15:33:52 -0500 Subject: [PATCH] test: Test addition to show incorrect allocator behavior If a RAID LV has images that are spread across more than one PV and you allocate a new image that requires more than one PV, parallel_areas is only honored for one segment. This commit adds a test for this condition. --- test/shell/lvconvert-raid.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh index 6f17303b5..8bd56ec78 100644 --- a/test/shell/lvconvert-raid.sh +++ b/test/shell/lvconvert-raid.sh @@ -202,4 +202,26 @@ for i in {1..3}; do lvremove -ff $vg done +# Setup 2-way RAID1 LV to spread across 4 devices. +# For each image: +# - metadata LV + 1 image extent (2 total extents) on one PV +# - 2 image extents on the other PV +# Then attempt allocation of another image from 2 extents on +# a 5th PV and the remainder of the rest of already used PVs. +# +# This should fail because there is insufficient space on the +# non-parallel PV (i.e. there is not enough space for the image +# if it doesn't share a PV with another image). +lvcreate --type raid1 -m 1 -l 3 -n $lv1 $vg \ + "$dev1:0-1" "$dev2:0-1" "$dev3:0-1" "$dev4:0-1" +aux wait_for_sync $vg $lv1 +# Should not be enough non-overlapping space. +not lvconvert -m +1 $vg/$lv1 \ + "$dev5:0-1" "$dev1" "$dev2" "$dev3" "$dev4" +# Should work due to '--alloc anywhere' +lvconvert -m +1 --alloc anywhere $vg/$lv1 \ + "$dev5:0-1" "$dev1" "$dev2" "$dev3" "$dev4" +lvremove -ff $vg + + vgremove -ff $vg -- 2.43.5