All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - lvmlockd: use transient LV lock when creating snapshot
Date: Mon,  9 Mar 2020 17:28:39 +0000 (GMT)	[thread overview]
Message-ID: <20200309172839.88E75394201F@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=dd0fdd846d85d7028e65bb801c27791a8e2cee2d
Commit:        dd0fdd846d85d7028e65bb801c27791a8e2cee2d
Parent:        a5b1b52903fe3c71e8515f5592ab10d69896b5e7
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Mon Mar 9 12:25:26 2020 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Mon Mar 9 12:25:26 2020 -0500

lvmlockd: use transient LV lock when creating snapshot

Creating a snapshot was using a persistent LV lock
on the origin, so if the origin LV was inactive at
the time of the snapshot the LV lock would remain.
(Running lvchange -an on the inactive LV would
clear the LV lock.)  Use a transient LV lock so it
will be dropped if it was not locked previously.
---
 lib/locking/lvmlockd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 416121011..e378fe6cb 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -2679,7 +2679,7 @@ int lockd_init_lv(struct cmd_context *cmd, struct volume_group *vg, struct logic
 			log_error("Failed to find origin LV %s/%s", vg->name, lp->origin_name);
 			return 0;
 		}
-		if (!lockd_lv(cmd, origin_lv, "ex", LDLV_PERSISTENT)) {
+		if (!lockd_lv(cmd, origin_lv, "ex", 0)) {
 			log_error("Failed to lock origin LV %s/%s", vg->name, lp->origin_name);
 			return 0;
 		}




                 reply	other threads:[~2020-03-09 17:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200309172839.88E75394201F@sourceware.org \
    --to=teigland@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.