Jan Pokorny a25a6f
From 4103df5ddaae49d51640d01502e8456409a92be9 Mon Sep 17 00:00:00 2001
Jan Pokorny a25a6f
From: Vojtech Trefny <vtrefny@redhat.com>
Jan Pokorny a25a6f
Date: Thu, 5 May 2022 16:35:37 +0200
Jan Pokorny a25a6f
Subject: [PATCH] Use LVM PV format current_size in
Jan Pokorny a25a6f
 LVMVolumeGroupDevice._remove
Jan Pokorny a25a6f
Jan Pokorny a25a6f
The member format size is 0 when target size is not set.
Jan Pokorny a25a6f
Jan Pokorny a25a6f
Related: rhbz#2081278
Jan Pokorny a25a6f
---
Jan Pokorny a25a6f
 blivet/devices/lvm.py | 2 +-
Jan Pokorny a25a6f
 1 file changed, 1 insertion(+), 1 deletion(-)
Jan Pokorny a25a6f
Jan Pokorny a25a6f
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
Jan Pokorny a25a6f
index feb92f2e..facb1b76 100644
Jan Pokorny a25a6f
--- a/blivet/devices/lvm.py
Jan Pokorny a25a6f
+++ b/blivet/devices/lvm.py
Jan Pokorny a25a6f
@@ -289,7 +289,7 @@ class LVMVolumeGroupDevice(ContainerDevice):
Jan Pokorny a25a6f
 
Jan Pokorny a25a6f
         # do not run pvmove on empty PVs
Jan Pokorny a25a6f
         member.format.update_size_info()
Jan Pokorny a25a6f
-        if member.format.free < member.format.size:
Jan Pokorny a25a6f
+        if member.format.free < member.format.current_size:
Jan Pokorny a25a6f
             blockdev.lvm.pvmove(member.path)
Jan Pokorny a25a6f
         blockdev.lvm.vgreduce(self.name, member.path)
Jan Pokorny a25a6f
 
Jan Pokorny a25a6f
-- 
Jan Pokorny a25a6f
2.34.3
Jan Pokorny a25a6f