All of lore.kernel.org
 help / color / mirror / Atom feed
* master - lvmlockd: use lock on thin pool when command names tdata
@ 2017-07-07 17:11 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2017-07-07 17:11 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a0f6135e5c53af8bb361932ebe8fec55a1804cc9
Commit:        a0f6135e5c53af8bb361932ebe8fec55a1804cc9
Parent:        fdd00ecdd1fd51605be1b616d712a2220ced8875
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri Jul 7 12:06:53 2017 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Jul 7 12:06:53 2017 -0500

lvmlockd: use lock on thin pool when command names tdata

Some lvconvert commands can be used directly on the data sublv:
lvconvert ... vg/pool_tdata

The correct LV lock to use in lvmlockd is the one on the pool LV.
---
 lib/locking/lvmlockd.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 92a970a..34b3882 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -2077,6 +2077,10 @@ static int _lockd_lv_thin(struct cmd_context *cmd, struct logical_volume *lv,
 	} else if (lv_is_thin_pool(lv)) {
 		pool_lv = lv;
 
+	} else if (lv_is_thin_pool_data(lv)) {
+		/* FIXME: there should be a function to get pool lv from data lv. */
+		pool_lv = lv_parent(lv);
+
 	} else {
 		/* This should not happen AFAIK. */
 		log_error("Lock on incorrect thin lv type %s/%s",



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-07 17:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-07 17:11 master - lvmlockd: use lock on thin pool when command names tdata David Teigland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.