summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2022-05-27 12:38:43 -0500
committerDavid Teigland <teigland@redhat.com>2022-06-09 14:33:30 -0500
commiteda98e4b9418568d6793d2c853aaa54db051cc9f (patch)
tree48954abe911c251d10f15d4c903a9b95caf776b4
parent45a2ccfa3bdf4c5b3f8b9e0cc5330fca345b0d26 (diff)
downloadlvm2-eda98e4b9418568d6793d2c853aaa54db051cc9f.tar.gz
devices file: move clean up after command is run
devices_file_exit wasn't being called between lvm_shell commands, so the file lock wouldn't be released.
-rw-r--r--lib/commands/toolcontext.c1
-rw-r--r--tools/lvmcmdline.c1
2 files changed, 1 insertions, 1 deletions
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index a0c78ddd6..7db5e11a1 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1912,7 +1912,6 @@ int refresh_toolcontext(struct cmd_context *cmd)
_destroy_segtypes(&cmd->segtypes);
_destroy_formats(cmd, &cmd->formats);
- devices_file_exit(cmd);
if (!dev_cache_exit())
stack;
_destroy_dev_types(cmd);
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 1727ba089..eb63fd9b5 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -3306,6 +3306,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
hints_exit(cmd);
lvmcache_destroy(cmd, 1, 1);
label_scan_destroy(cmd);
+ devices_file_exit(cmd);
if ((config_string_cft = remove_config_tree_by_source(cmd, CONFIG_STRING)))
dm_config_destroy(config_string_cft);