From 09aaa835e7a24d14451ef2638867291f8b636f37 Mon Sep 17 00:00:00 2001 From: miaoguanqin Date: Tue, 11 Oct 2022 17:06:35 +0800 Subject: [PATCH] lvm:remove no locking warning --- 0016-Move-nolocking-warning-to-man-page.patch | 49 +++++++++++++++++++ 0017-fix-args-entry-for-nolocking.patch | 29 +++++++++++ lvm2.spec | 7 ++- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 0016-Move-nolocking-warning-to-man-page.patch create mode 100644 0017-fix-args-entry-for-nolocking.patch diff --git a/0016-Move-nolocking-warning-to-man-page.patch b/0016-Move-nolocking-warning-to-man-page.patch new file mode 100644 index 0000000..08d24cf --- /dev/null +++ b/0016-Move-nolocking-warning-to-man-page.patch @@ -0,0 +1,49 @@ +From f1578b4a5d0bf49ab2b07c86c982cfa5aaa60a84 Mon Sep 17 00:00:00 2001 +From: David Teigland +Date: Fri, 25 Mar 2022 15:43:53 -0500 +Subject: [PATCH] Move nolocking warning to man page + +Conflict:NA +Reference:https://sourceware.org/git/?p=lvm2.git;a=commit;h=f1578b4a5d0bf49ab2b07c86c982cfa5aaa60a84 + +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. +--- + tools/args.h | 3 ++- + tools/lvmcmdline.c | 5 +---- + 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; +-- +2.27.0 + diff --git a/0017-fix-args-entry-for-nolocking.patch b/0017-fix-args-entry-for-nolocking.patch new file mode 100644 index 0000000..6468261 --- /dev/null +++ b/0017-fix-args-entry-for-nolocking.patch @@ -0,0 +1,29 @@ +From 86a0a652a9eedd932c7428ed82656f3fd40d13f8 Mon Sep 17 00:00:00 2001 +From: David Teigland +Date: Fri, 25 Mar 2022 17:25:29 -0500 +Subject: [PATCH] fix args entry for nolocking + +Conflict:NA +Reference:https://sourceware.org/git/?p=lvm2.git;a=commit;h=86a0a652a9eedd932c7428ed82656f3fd40d13f8 + +typo in previous commit +--- + tools/args.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/args.h b/tools/args.h +index ecb650234..03fe24556 100644 +--- a/tools/args.h ++++ b/tools/args.h +@@ -499,7 +499,7 @@ 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. Use with caution, concurrent commands may produce\n") ++ "Disable locking. Use with caution, concurrent commands may produce\n" + "incorrect results.\n") + + arg(norestorefile_ARG, '\0', "norestorefile", 0, 0, 0, +-- +2.27.0 + diff --git a/lvm2.spec b/lvm2.spec index cfacb24..188f443 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -43,7 +43,7 @@ Name: lvm2 Version: 2.03.14 -Release: 6 +Release: 7 Epoch: 8 Summary: Tools for logical volume management License: GPLv2+ and LGPLv2.1 and BSD @@ -64,6 +64,8 @@ Patch12: 0012-13-dm-disk.rules-check-DM_NAME-before-create-symlink.patch Patch13: 0013-dev_name-determine-whether-the-dev-aliases-linked-li.patch Patch14: 0014-lvm-code-reduce-cyclomatic-complexity.patch Patch15: 0015-_vg_read_raw_area-fix-segfault-caused-by-using-null-.patch +Patch16: 0016-Move-nolocking-warning-to-man-page.patch +Patch17: 0017-fix-args-entry-for-nolocking.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -490,6 +492,9 @@ fi %changelog +* Tue Oct 11 2022 miaoguanqin - 8:2.03.14-7 +- lvm: remove no locking warning + * Sun Sep 04 2022 wuguanghao - 8:2.03.14-6 - lvm: fix segfault of pvscan --cache -- Gitee