master - lvmlockd: always disallow mirror splitting
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3071837e21fae8907c1d584f9181e0589b9ce7e2 Commit: 3071837e21fae8907c1d584f9181e0589b9ce7e2 Parent: 09c792c20667aa8d7fb2799e484d913a5eb8a147 Author: David Teigland <[email protected]> AuthorDate: Tue Sep 5 10:26:58 2017 -0500 Committer: David Teigland <[email protected]> CommitterDate: Tue Sep 5 10:28:33 2017 -0500
lvmlockd: always disallow mirror splitting
lv_raid_split() was correctly prevented in a shared VG, but lv_raid_split_and_track() was missing that check.
--- WHATS_NEW | 1 + lib/metadata/raid_manip.c | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.174 - ================================= + Prevent raid1 split with trackchanges in a shared VG. Avoid double unlocking of client & lockspace mutexes in lvmlockd. Fix leaking of file descriptor for non-blocking filebased locking. Fix check for 2nd mda at end of disk fits if using pvcreate --restorefile.
lib/metadata/raid_manip.c +6 -0
@@ -3426,6 +3426,12 @@ int lv_raid_split_and_track(struct logical_volume *lv,int s;struct lv_segment *seg =first_seg (lv); +if (is_lockd_type (lv->vg->lock_type)) { +log_error ("Splitting raid image is not allowed with lock_type %s." , + lv->vg->lock_type); +return 0 ; + } +if (!seg_is_mirrored (seg)) {log_error ("Unable to split images from non-mirrored RAID." );return 0 ;