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

d0283b
From 28a4df481fa47d0b71996a25ac08546c4bd094f8 Mon Sep 17 00:00:00 2001
d0283b
From: David Teigland <teigland@redhat.com>
d0283b
Date: Fri, 27 May 2022 12:38:43 -0500
d0283b
Subject: [PATCH 1/7] devices file: move clean up after command is run
d0283b
d0283b
devices_file_exit wasn't being called between lvm_shell
d0283b
commands, so the file lock wouldn't be released.
d0283b
d0283b
(cherry picked from commit 9dfa6f38793f6b5f7de2a4148ab2f7790e3c39da)
d0283b
---
d0283b
 lib/commands/toolcontext.c | 2 --
d0283b
 tools/lvmcmdline.c         | 1 +
d0283b
 2 files changed, 1 insertion(+), 2 deletions(-)
d0283b
d0283b
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
d0283b
index 4cb81bf94..2666d7b42 100644
d0283b
--- a/lib/commands/toolcontext.c
d0283b
+++ b/lib/commands/toolcontext.c
d0283b
@@ -1905,7 +1905,6 @@ int refresh_toolcontext(struct cmd_context *cmd)
d0283b
 	_destroy_segtypes(&cmd->segtypes);
d0283b
 	_destroy_formats(cmd, &cmd->formats);
d0283b
 
d0283b
-	devices_file_exit(cmd);
d0283b
 	if (!dev_cache_exit())
d0283b
 		stack;
d0283b
 	_destroy_dev_types(cmd);
d0283b
@@ -2034,7 +2033,6 @@ void destroy_toolcontext(struct cmd_context *cmd)
d0283b
 	_destroy_segtypes(&cmd->segtypes);
d0283b
 	_destroy_formats(cmd, &cmd->formats);
d0283b
 	_destroy_filters(cmd);
d0283b
-	devices_file_exit(cmd);
d0283b
 	dev_cache_exit();
d0283b
 	_destroy_dev_types(cmd);
d0283b
 	_destroy_tags(cmd);
d0283b
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
d0283b
index 1e3547ed7..b052d698f 100644
d0283b
--- a/tools/lvmcmdline.c
d0283b
+++ b/tools/lvmcmdline.c
d0283b
@@ -3305,6 +3305,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
d0283b
 	hints_exit(cmd);
d0283b
 	lvmcache_destroy(cmd, 1, 1);
d0283b
 	label_scan_destroy(cmd);
d0283b
+	devices_file_exit(cmd);
d0283b
 
d0283b
 	if ((config_string_cft = remove_config_tree_by_source(cmd, CONFIG_STRING)))
d0283b
 		dm_config_destroy(config_string_cft);
d0283b
-- 
d0283b
2.34.3
d0283b