From 3071837e21fae8907c1d584f9181e0589b9ce7e2 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Tue, 5 Sep 2017 10:26:58 -0500 Subject: [PATCH] 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(+) diff --git a/WHATS_NEW b/WHATS_NEW index 32bbc4194..e6cc18db0 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -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. diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 043292849..72223ca91 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -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; -- 2.43.5