Skip to contentSkip to conversation

master - lvmlockd: use pool lock for tmeta access

PATCH David Teigland 1 participant 1 message Dec 5, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b910c34f09f45987fe56f0e90455a166e047144c
Commit:        b910c34f09f45987fe56f0e90455a166e047144c
Parent:        b9e419850086473d4309c5211852b0237020421d
Author:        David Teigland <[email protected]>
AuthorDate:    Tue Dec 5 14:31:03 2017 -0600
Committer:     David Teigland <[email protected]>
CommitterDate: Tue Dec 5 14:31:03 2017 -0600

lvmlockd: use pool lock for tmeta access

When a command is run on a named tmeta LV, use
the lock on the pool.

---
 lib/locking/lvmlockd.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
lib/locking/lvmlockd.c +4 -0
index d8bb818..eb7076c 100644
@@ -2161,6 +2161,10 @@ static int _lockd_lv_thin(struct cmd_context *cmd, struct logical_volume *lv,
 		/* FIXME: there should be a function to get pool lv from data lv. */
 		pool_lv = lv_parent(lv);
 
+	} else if (lv_is_thin_pool_metadata(lv)) {
+		struct lv_segment *pool_seg = get_only_segment_using_this_lv(lv);
+		pool_lv = pool_seg->lv;
+
 	} else {
 		/* This should not happen AFAIK. */
 		log_error("Lock on incorrect thin lv type %s/%s",