summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2020-03-09 12:25:26 -0500
committerDavid Teigland <teigland@redhat.com>2020-03-09 12:25:26 -0500
commitdd0fdd846d85d7028e65bb801c27791a8e2cee2d (patch)
tree33f1c0d13df6ac4cf81c3a14e74b3f553a14b43b
parenta5b1b52903fe3c71e8515f5592ab10d69896b5e7 (diff)
downloadlvm2-dd0fdd846d85d7028e65bb801c27791a8e2cee2d.tar.gz
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.
-rw-r--r--lib/locking/lvmlockd.c2
1 files changed, 1 insertions, 1 deletions
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;
}