From efc07e899ad52953fca3f1856a98f4b651725061 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Thu, 16 Apr 2026 15:16:46 +0200 Subject: [PATCH] Account for unusable space in the PV in LVMFactory Resolves: RHEL-45174 --- ...usable-space-in-the-PV-in-LVMFactory.patch | 28 +++++++++++++++++++ python-blivet.spec | 7 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0005-Account-for-unusable-space-in-the-PV-in-LVMFactory.patch diff --git a/0005-Account-for-unusable-space-in-the-PV-in-LVMFactory.patch b/0005-Account-for-unusable-space-in-the-PV-in-LVMFactory.patch new file mode 100644 index 0000000..45480d0 --- /dev/null +++ b/0005-Account-for-unusable-space-in-the-PV-in-LVMFactory.patch @@ -0,0 +1,28 @@ +From 342802d2575a51b71560849d1f638b7d898f3398 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 28 Jan 2026 09:35:36 +0100 +Subject: [PATCH] Account for unusable space in the PV in LVMFactory + +When calculating the amount of space needed in the factory, we +need to take PV metadata and alignment in account to make sure +the VG has enough free space for the LV which is being created. + +Resolves: RHEL-45174 +--- + blivet/devicefactory.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py +index e02f6c4f8..43a9c0eb6 100644 +--- a/blivet/devicefactory.py ++++ b/blivet/devicefactory.py +@@ -1442,6 +1442,9 @@ def _get_total_space(self): + space -= self.vg.free_space + # we need to account for the LVM metadata being placed somewhere + space += self.vg.lvm_metadata_space ++ # account for unusable space in the PV (difference between PV size and its usable ++ # space), this is dues to PV metadata and data alignment to ++ space += sum(pv.size - self.vg._get_pv_usable_space(pv) for pv in self.vg.parents) + else: + # we need to account for the LVM metadata being placed on each disk + # (and thus taking up to one extent from each disk) diff --git a/python-blivet.spec b/python-blivet.spec index 9235d0d..3b5a6e1 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -5,7 +5,7 @@ Version: 3.13.0 #%%global prerelease .b2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 5%{?prerelease}%{?dist} +Release: 6%{?prerelease}%{?dist} Epoch: 1 License: LGPL-2.1-or-later %global realname blivet @@ -20,6 +20,7 @@ Patch0: 0001-remove-btrfs-plugin.patch Patch2: 0002-iSCSI-dont-crash-when-LUN-ID-256.patch Patch3: 0003-Fix-luks-save_passphrase-for-missing-format-context.patch Patch4: 0004-Fix-getting-iSCSI-firmware-initiator-name.patch +Patch5: 0005-Account-for-unusable-space-in-the-PV-in-LVMFactory.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -117,6 +118,10 @@ make DESTDIR=%{buildroot} install %{python3_sitelib}/* %changelog +* Thu Apr 16 2026 Vojtech Trefny - 3.13.0-6 +- Account for unusable space in the PV in LVMFactory + Resolves: RHEL-45174 + * Wed Feb 04 2026 Vojtech Trefny - 3.13.0-5 - Fix getting iSCSI firmware initiator name Resolves: RHEL-145882