1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
David Teigland 2022-03-25 15:43:53 -05:00
parent 72f0b637d2
commit f1578b4a5d
2 changed files with 3 additions and 5 deletions

View File

@ -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"

View File

@ -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;