Blob Blame History Raw
From 8b72cf35f3c758aca31269f454339fdffeccbcf0 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 12 Jun 2017 13:15:34 +0100
Subject: [PATCH] daemon: lvm: Pass --yes option to force pvresize
 (RHBZ#1460577).
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

LVM2 >= 2.02.171 requires the ‘--yes’ option to force pvresize to work
in various circumstances, eg. reducing the size of an existing PV.

Pass this flag unconditionally.

Note this does NOT break earlier versions which just ignore this flag.

(cherry picked from commit 8a98fe91b889f666c8160f4c23af220247b4b8f3)
---
 daemon/lvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/daemon/lvm.c b/daemon/lvm.c
index a270b13..085e852 100644
--- a/daemon/lvm.c
+++ b/daemon/lvm.c
@@ -625,6 +625,7 @@ do_pvresize_size (const char *device, int64_t size)
 
   r = command (NULL, &err,
                str_lvm, "pvresize",
+               "--yes",
                "--setphysicalvolumesize", buf,
                device, NULL);
   if (r == -1) {
-- 
2.9.4