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

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