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:
parent
8c5517e01d
commit
8322deefee
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.96 -
|
Version 2.02.96 -
|
||||||
================================
|
================================
|
||||||
|
Disallow snapshots of mirror segment type.
|
||||||
Fix bug in cmirror that caused incorrect status info to print on some nodes.
|
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.
|
Remove statement that snapshots cannot be tagged from lvm man page.
|
||||||
Disallow changing cluster attribute of VG while RAID LVs are active.
|
Disallow changing cluster attribute of VG while RAID LVs are active.
|
||||||
|
@ -4208,12 +4208,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((org->status & MIRROR_IMAGE) ||
|
if (lv_is_mirror_type(org) &&
|
||||||
(org->status & MIRROR_LOG)) {
|
!seg_is_raid(first_seg(org))) {
|
||||||
log_error("Snapshots of mirror %ss "
|
log_error("Snapshots of \"mirror\" segment types"
|
||||||
"are not supported",
|
" are not supported");
|
||||||
(org->status & MIRROR_LOG) ?
|
|
||||||
"log" : "image");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,13 @@
|
|||||||
|
|
||||||
. lib/test
|
. 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 prepare_vg 5
|
||||||
aux lvmconf 'allocation/maximise_cling = 0'
|
aux lvmconf 'allocation/maximise_cling = 0'
|
||||||
aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1'
|
aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1'
|
||||||
|
@ -13,9 +13,15 @@
|
|||||||
|
|
||||||
aux prepare_vg 4
|
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 -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
|
# Down-convert (mirror -> linear) under a snapshot
|
||||||
lvconvert -m0 $vg/lv
|
lvconvert -m0 $vg/lv
|
||||||
|
@ -11,6 +11,14 @@
|
|||||||
|
|
||||||
. lib/test
|
. 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
|
aux prepare_vg 5
|
||||||
|
|
||||||
lvcreate -m 3 --ig -L 2M -n 4way $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5":0
|
lvcreate -m 3 --ig -L 2M -n 4way $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5":0
|
||||||
|
Loading…
Reference in New Issue
Block a user