From 287565fd5dd5f49f1a51c6cd9ebdc9c20ebc7730 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
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

