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

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