Blame SOURCES/0049-devices-file-move-clean-up-after-command-is-run.patch

ab86b0
From eda98e4b9418568d6793d2c853aaa54db051cc9f Mon Sep 17 00:00:00 2001
ab86b0
From: David Teigland <teigland@redhat.com>
ab86b0
Date: Fri, 27 May 2022 12:38:43 -0500
ab86b0
Subject: [PATCH 49/54] devices file: move clean up after command is run
ab86b0
ab86b0
devices_file_exit wasn't being called between lvm_shell
ab86b0
commands, so the file lock wouldn't be released.
ab86b0
---
ab86b0
 lib/commands/toolcontext.c | 1 -
ab86b0
 tools/lvmcmdline.c         | 1 +
ab86b0
 2 files changed, 1 insertion(+), 1 deletion(-)
ab86b0
ab86b0
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
ab86b0
index a0c78ddd6..7db5e11a1 100644
ab86b0
--- a/lib/commands/toolcontext.c
ab86b0
+++ b/lib/commands/toolcontext.c
ab86b0
@@ -1912,7 +1912,6 @@ int refresh_toolcontext(struct cmd_context *cmd)
ab86b0
 	_destroy_segtypes(&cmd->segtypes);
ab86b0
 	_destroy_formats(cmd, &cmd->formats);
ab86b0
 
ab86b0
-	devices_file_exit(cmd);
ab86b0
 	if (!dev_cache_exit())
ab86b0
 		stack;
ab86b0
 	_destroy_dev_types(cmd);
ab86b0
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
ab86b0
index 1727ba089..eb63fd9b5 100644
ab86b0
--- a/tools/lvmcmdline.c
ab86b0
+++ b/tools/lvmcmdline.c
ab86b0
@@ -3306,6 +3306,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
ab86b0
 	hints_exit(cmd);
ab86b0
 	lvmcache_destroy(cmd, 1, 1);
ab86b0
 	label_scan_destroy(cmd);
ab86b0
+	devices_file_exit(cmd);
ab86b0
 
ab86b0
 	if ((config_string_cft = remove_config_tree_by_source(cmd, CONFIG_STRING)))
ab86b0
 		dm_config_destroy(config_string_cft);
ab86b0
-- 
ab86b0
2.34.3
ab86b0