summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJonathan Earl Brassow <jbrassow@redhat.com>2012-05-05 02:08:46 +0000
committerJonathan Earl Brassow <jbrassow@redhat.com>2012-05-05 02:08:46 +0000
commiteb2d70293d06d23b2224df6728c46ff8eafe9ed9 (patch)
tree803af7f0743668e49ea81bed475d0e234d876eb7 /test
parent1e4e9548b167ca2a76a0bbb3a5a347c062b84361 (diff)
downloadlvm2-eb2d70293d06d23b2224df6728c46ff8eafe9ed9.tar.gz
lvm2-eb2d70293d06d23b2224df6728c46ff8eafe9ed9.tar.xz
lvm2-eb2d70293d06d23b2224df6728c46ff8eafe9ed9.zip
Fix up-convert when mirror activation is controled by volume_list and tags.
When mirrors are up-converted, a transient mirror layer is put in so that only the new devices are sync'ed. That transient layer must carry the tags of the original mirror LV, otherwise it will fail to activate when activation is regulated by lvm.conf:activation/volume_list. The conversion would then fail. The fix is to do exactly the same thing that is being done for linear -> mirror converting (lib/metadata/mirror.c:_init_mirror_log()). We copy the tags temporarily for the new LV and remove them after the activation.
Diffstat (limited to 'test')
-rw-r--r--test/shell/lvconvert-mirror.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 8b02dc84..3f572e51 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -15,16 +15,28 @@ wait_for_mirror_in_sync_() {
while test $(get lv_field $1 copy_percent) != "100.00"; do sleep 1; done
}
-# convert from linear to 2-way mirror
aux prepare_pvs 5 10
# FIXME - test fails with extent size < 512k
vgcreate -c n -s 512k $vg $(cat DEVICES)
+# convert from linear to 2-way mirror
lvcreate -l2 -n $lv1 $vg "$dev1"
lvconvert -i1 -m+1 $vg/$lv1 "$dev2" "$dev3:0-1"
check mirror $vg $lv1 "$dev3"
lvremove -ff $vg
+# convert from linear to 2-way mirror - with tags and volume_list (bz683270)
+lvcreate -l2 -n $lv1 $vg --addtag hello
+lvconvert -i1 -m+1 $vg/$lv1 \
+ --config 'activation { volume_list = [ "@hello" ] }'
+lvremove -ff $vg
+
+# convert from 2-way to 3-way mirror - with tags and volume_list (bz683270)
+lvcreate -l2 -m1 -n $lv1 $vg --addtag hello
+lvconvert -i1 -m+1 $vg/$lv1 \
+ --config 'activation { volume_list = [ "@hello" ] }'
+lvremove -ff $vg
+
# convert from 2-way mirror to linear
lvcreate -l2 -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:0-1"
lvconvert -m-1 $vg/$lv1