summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2022-03-25 15:43:53 -0500
committerDavid Teigland <teigland@redhat.com>2022-03-25 15:43:53 -0500
commitf1578b4a5d0bf49ab2b07c86c982cfa5aaa60a84 (patch)
tree42074d66ed7e2755b7db3c7922b842409094c66c
parent72f0b637d239c893ca49b05b83e2ebddc327e900 (diff)
downloadlvm2-f1578b4a5d0bf49ab2b07c86c982cfa5aaa60a84.tar.gz
Move nolocking warning to man page
It's more logical to warn about --nolocking in the man page before it's used rather than after it's used and too late. Also, warnings are usually for things the user may not know.
-rw-r--r--tools/args.h3
-rw-r--r--tools/lvmcmdline.c5
2 files changed, 3 insertions, 5 deletions
diff --git a/tools/args.h b/tools/args.h
index 56669645d..ecb650234 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -499,7 +499,8 @@ arg(nohistory_ARG, '\0', "nohistory", 0, 0, 0,
"metadata/record_lvs_history is enabled.\n")
arg(nolocking_ARG, '\0', "nolocking", 0, 0, 0,
- "Disable locking.\n")
+ "Disable locking. Use with caution, concurrent commands may produce\n")
+ "incorrect results.\n")
arg(norestorefile_ARG, '\0', "norestorefile", 0, 0, 0,
"In conjunction with --uuid, this allows a uuid to be specified\n"
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 241c6df18..1e3547ed7 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -3267,10 +3267,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
if (arg_is_set(cmd, readonly_ARG))
readonly = 1;
- if (cmd->nolocking) {
- if (!_cmd_no_meta_proc(cmd))
- log_warn("WARNING: File locking is disabled.");
- } else {
+ if (!cmd->nolocking) {
if (!init_locking(cmd, sysinit, readonly, cmd->ignorelockingfailure)) {
ret = ECMD_FAILED;
goto_out;