From 1e240c89d6d74255e427ba42f23b8efea3c109f1 Mon Sep 17 00:00:00 2001 From: wguanghao Date: Wed, 28 Jul 2021 11:04:03 +0800 Subject: [PATCH] lvreduce support --yes option --- 0013-lvreduce-support-yes.patch | 26 ++++++++++++++++++++++++++ lvm2.spec | 6 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0013-lvreduce-support-yes.patch diff --git a/0013-lvreduce-support-yes.patch b/0013-lvreduce-support-yes.patch new file mode 100644 index 0000000..e762126 --- /dev/null +++ b/0013-lvreduce-support-yes.patch @@ -0,0 +1,26 @@ +From 287565fd5dd5f49f1a51c6cd9ebdc9c20ebc7730 Mon Sep 17 00:00:00 2001 +From: Zdenek Kabelac +Date: Tue, 6 Apr 2021 12:26:42 +0200 +Subject: [PATCH] lvreduce: support --yes + +Missed support for --yes with 'lvreduce' to answer 'y' to prompt. +--- + lib/metadata/lv_manip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c +index 81346bd..b38acf8 100644 +--- a/lib/metadata/lv_manip.c ++++ b/lib/metadata/lv_manip.c +@@ -4970,7 +4970,7 @@ static int _request_confirmation(const struct logical_volume *lv, + + log_warn("THIS MAY DESTROY YOUR DATA (filesystem etc.)"); + +- if (!lp->force) { ++ if (!lp->force && !lp->yes) { + if (yes_no_prompt("Do you really want to reduce %s? [y/n]: ", + display_lvname(lv)) == 'n') { + log_error("Logical volume %s NOT reduced.", +-- +1.8.3.1 + diff --git a/lvm2.spec b/lvm2.spec index a9f392b..51c24aa 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -43,7 +43,7 @@ Name: lvm2 Version: 2.03.11 -Release: 3 +Release: 4 Epoch: 8 Summary: Tools for logical volume management License: GPLv2+ and LGPLv2.1 and BSD @@ -61,6 +61,7 @@ Patch9: 0009-enhancement-add-dfx-log.patch Patch10: 0010-enhancement-syslog-more-when-use-libdevmapper-so.patch Patch11: 0011-enhancement-log-it-when-disk-slow.patch Patch12: 0012-bugfix-lvm2-fix-the-reuse-of-va_list.patch +Patch13: 0013-lvreduce-support-yes.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -485,6 +486,9 @@ fi %changelog +* Wed Jul 28 2021 wuguanghao - 8.2.03.11-4 +- lvreduce support --yes option + * Mon Jul 26 2021 wuguanghao - 8.2.03.11-3 - revert commit of fix VERSION issue when packaging -- Gitee