neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone

Blame SOURCES/0017-Use-LVM-PV-format-current_size-in-LVMVolumeGroupDevi.patch

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