From 9d7c19c2ce1872cc185e64c9fa4e27ab486c5975 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Mon, 23 Sep 2024 17:12:03 -0500 Subject: [PATCH] lvmlockd: fix previous thin locking fix Restore the original lvremove locking for non-thin LVs that were changed in the thin locking fix. --- lib/metadata/lv_manip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 1dce4ba49..86a3098ed 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -7629,7 +7629,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, if (!lockd_lv(cmd, lock_lv, "ex", LDLV_PERSISTENT)) return_0; } else { - if (!lockd_lv(cmd, lock_lv, "ex", 0)) + if (!lockd_lv(cmd, lock_lv, "ex", LDLV_PERSISTENT)) return_0; } } @@ -7784,6 +7784,9 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, if (lockd_pool && !thin_pool_is_active(lockd_pool)) { if (!lockd_lv_name(cmd, vg, lockd_pool->name, &lockd_pool->lvid.id[1], lockd_pool->lock_args, "un", LDLV_PERSISTENT)) log_warn("WARNING: Failed to unlock %s.", display_lvname(lockd_pool)); + } else { + if (!lockd_lv(cmd, lv, "un", LDLV_PERSISTENT)) + log_warn("WARNING: Failed to unlock %s.", display_lvname(lv)); } lockd_free_lv(cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args); -- 2.43.5