1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Disallow snapshots of mirror segment types.

Snapshots of RAID logical volumes are allowed (including "raid1").  However,
snapshots of "mirror" logical volumes has been disallowed due to unsolvable
issues inherent to the design.  The fact that mirroring (dm-raid1.c) must
stop all I/O as the result of a failure and wait for userspace intervention
can lead to a circular dependency if userspace is simultaneously waiting for
snapshots (on mirrors) to make an I/O update before proceeding.

Various snapshot on mirror tests have been removed as a result.
This commit is contained in:
Jonathan Earl Brassow 2012-05-01 19:21:24 +00:00
parent 8c5517e01d
commit 8322deefee
5 changed files with 28 additions and 8 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.96 -
================================
Disallow snapshots of mirror segment type.
Fix bug in cmirror that caused incorrect status info to print on some nodes.
Remove statement that snapshots cannot be tagged from lvm man page.
Disallow changing cluster attribute of VG while RAID LVs are active.

View File

@ -4208,12 +4208,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
return NULL;
}
if ((org->status & MIRROR_IMAGE) ||
(org->status & MIRROR_LOG)) {
log_error("Snapshots of mirror %ss "
"are not supported",
(org->status & MIRROR_LOG) ?
"log" : "image");
if (lv_is_mirror_type(org) &&
!seg_is_raid(first_seg(org))) {
log_error("Snapshots of \"mirror\" segment types"
" are not supported");
return NULL;
}

View File

@ -11,6 +11,13 @@
. lib/test
exit 0
#
# Snapshots of 'mirrors' are not supported. They can no longer be created.
# This file could be used to test some aspect of lvconvert, snapshot, and
# RAID at some point though...
#
aux prepare_vg 5
aux lvmconf 'allocation/maximise_cling = 0'
aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1'

View File

@ -13,9 +13,15 @@
aux prepare_vg 4
# Create snapshot of a mirror origin
# Attempt to create snapshot of a mirror origin - should fail
lvcreate -m 1 -L 10M -n lv $vg
lvcreate -s $vg/lv -L 10M -n snap
not lvcreate -s $vg/lv -L 10M -n snap
exit 0
#
# Snapshots of mirrors are no longer allowed.
#
# Down-convert (mirror -> linear) under a snapshot
lvconvert -m0 $vg/lv

View File

@ -11,6 +11,14 @@
. lib/test
exit 0
#
# Snapshots of 'mirrors' are not supported. They can no longer be created.
# This file could be used to test some aspect of vgreduce, snapshot, and
# RAID at some point though...
#
aux prepare_vg 5
lvcreate -m 3 --ig -L 2M -n 4way $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5":0