diff --git a/SOURCES/0009-Improve-error-message-printed-for-missing-dependecie.patch b/SOURCES/0009-Improve-error-message-printed-for-missing-dependecie.patch new file mode 100644 index 0000000..f267c3c --- /dev/null +++ b/SOURCES/0009-Improve-error-message-printed-for-missing-dependecie.patch @@ -0,0 +1,65 @@ +From 46335861073882b7162221fc0995dc1df3c67749 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Fri, 6 Aug 2021 16:37:51 +0200 +Subject: [PATCH] Improve error message printed for missing dependecies + +The existing error message can be confusing for people that don't +know internals of blivet and libblockdev and the information what +is actually broken or not installed on the system is missing +completely. Example for LVM VDO with missing kvdo module: + +Before: + +device type lvmvdopool requires unavailable_dependencies: +libblockdev lvm plugin (vdo technology) + +After: + +device type lvmvdopool requires unavailable_dependencies: +libblockdev lvm plugin (vdo technology): +libblockdev plugin lvm is loaded but some required technologies +are not available (BD_LVM_TECH_VDO: Kernel module 'kvdo' not +available) +--- + blivet/deviceaction.py | 2 +- + blivet/tasks/availability.py | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py +index 56e29215..0458e4be 100644 +--- a/blivet/deviceaction.py ++++ b/blivet/deviceaction.py +@@ -173,7 +173,7 @@ class DeviceAction(util.ObjectID): + def _check_device_dependencies(self): + unavailable_dependencies = self.device.unavailable_dependencies + if unavailable_dependencies: +- dependencies_str = ", ".join(str(d) for d in unavailable_dependencies) ++ dependencies_str = ", ".join("%s:\n%s" % (str(d), ", ".join(d.availability_errors)) for d in unavailable_dependencies) + raise DependencyError("device type %s requires unavailable_dependencies: %s" % (self.device.type, dependencies_str)) + + def apply(self): +diff --git a/blivet/tasks/availability.py b/blivet/tasks/availability.py +index 1fd80590..1537f3f5 100644 +--- a/blivet/tasks/availability.py ++++ b/blivet/tasks/availability.py +@@ -224,7 +224,7 @@ class BlockDevMethod(Method): + try: + self._tech_info.check_fn(tech, mode) + except GLib.GError as e: +- errors.append(str(e)) ++ errors.append("%s: %s" % (tech.value_name, e.message)) + return errors + + def availability_errors(self, resource): +@@ -242,7 +242,7 @@ class BlockDevMethod(Method): + tech_missing = self._check_technologies() + if tech_missing: + return ["libblockdev plugin %s is loaded but some required " +- "technologies are not available:\n%s" % (self._tech_info.plugin_name, tech_missing)] ++ "technologies are not available (%s)" % (self._tech_info.plugin_name, "; ".join(tech_missing))] + else: + return [] + +-- +2.31.1 + diff --git a/SOURCES/0010-Use-bigger-chunk-size-for-thinpools-bigger-than-15.8.patch b/SOURCES/0010-Use-bigger-chunk-size-for-thinpools-bigger-than-15.8.patch new file mode 100644 index 0000000..68ab727 --- /dev/null +++ b/SOURCES/0010-Use-bigger-chunk-size-for-thinpools-bigger-than-15.8.patch @@ -0,0 +1,90 @@ +From 06cafbbbbff0aae3634eb2908d25d0dc46c2048b Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Tue, 9 Nov 2021 15:52:48 +0100 +Subject: [PATCH] Use bigger chunk size for thinpools bigger than ~15.88 TiB + +With our default chunk size of 64 KiB we cannot create bigger +thin pools than 15.88 TiB. Unfortunately we need to specify chunk +size to be able to calculate thin metadata properly so we can't +simply leave this to LVM to determine the correct chunk size. +--- + blivet/devicelibs/lvm.py | 11 +++++++++++ + blivet/devices/lvm.py | 6 +++--- + tests/devices_test/lvm_test.py | 11 +++++++++++ + 3 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py +index d56a76ed..cb6f655e 100644 +--- a/blivet/devicelibs/lvm.py ++++ b/blivet/devicelibs/lvm.py +@@ -20,6 +20,7 @@ + # Author(s): Dave Lehman + # + ++import math + import os + import re + +@@ -51,6 +52,7 @@ LVM_THINP_MIN_METADATA_SIZE = Size("2 MiB") + LVM_THINP_MAX_METADATA_SIZE = Size("16 GiB") + LVM_THINP_MIN_CHUNK_SIZE = Size("64 KiB") + LVM_THINP_MAX_CHUNK_SIZE = Size("1 GiB") ++LVM_THINP_ADDRESSABLE_CHUNK_SIZE = Size("17455015526400 B") # 15.88 TiB + + raid_levels = raid.RAIDLevels(["linear", "striped", "raid1", "raid4", "raid5", "raid6", "raid10"]) + raid_seg_types = list(itertools.chain.from_iterable([level.names for level in raid_levels if level.name != "linear"])) +@@ -225,3 +227,12 @@ def is_lvm_name_valid(name): + return False + + return True ++ ++ ++def recommend_thpool_chunk_size(thpool_size): ++ # calculation of the recommended chunk size by LVM is so complicated that we ++ # can't really replicate it, but we know that 64 KiB chunk size gives us ++ # upper limit of ~15.88 TiB so we will just add 64 KiB to the chunk size ++ # for every ~15.88 TiB of thinpool data size ++ return min(math.ceil(thpool_size / LVM_THINP_ADDRESSABLE_CHUNK_SIZE) * LVM_THINP_MIN_CHUNK_SIZE, ++ LVM_THINP_MAX_CHUNK_SIZE) +diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py +index 51d785d9..c61eeb4b 100644 +--- a/blivet/devices/lvm.py ++++ b/blivet/devices/lvm.py +@@ -1634,9 +1634,9 @@ class LVMThinPoolMixin(object): + return + + # we need to know chunk size to calculate recommended metadata size +- if self._chunk_size == 0: +- self._chunk_size = Size(blockdev.LVM_DEFAULT_CHUNK_SIZE) +- log.debug("Using default chunk size: %s", self._chunk_size) ++ if self._chunk_size == 0 or enforced: ++ self._chunk_size = lvm.recommend_thpool_chunk_size(self._size) ++ log.debug("Using recommended chunk size: %s", self._chunk_size) + + old_md_size = self._metadata_size + old_pmspare_size = self.vg.pmspare_size +diff --git a/tests/devices_test/lvm_test.py b/tests/devices_test/lvm_test.py +index 4156d0bf..336c5b99 100644 +--- a/tests/devices_test/lvm_test.py ++++ b/tests/devices_test/lvm_test.py +@@ -442,6 +442,17 @@ class LVMDeviceTest(unittest.TestCase): + self.assertFalse(pool.exists) + self.assertTrue(lvm.lvremove.called) + ++ def test_lvmthinpool_chunk_size(self): ++ pv = StorageDevice("pv1", fmt=blivet.formats.get_format("lvmpv"), ++ size=Size("100 TiB")) ++ vg = LVMVolumeGroupDevice("testvg", parents=[pv]) ++ pool = LVMLogicalVolumeDevice("pool1", parents=[vg], size=Size("500 MiB"), seg_type="thin-pool") ++ self.assertEqual(pool.chunk_size, Size("64 KiB")) ++ ++ pool.size = Size("16 TiB") ++ pool.autoset_md_size(enforced=True) ++ self.assertEqual(pool.chunk_size, Size("128 KiB")) ++ + + class TypeSpecificCallsTest(unittest.TestCase): + def test_type_specific_calls(self): +-- +2.31.1 + diff --git a/SOURCES/0011-iscsi-Replace-all-log_exception_info-calls-with-log.patch b/SOURCES/0011-iscsi-Replace-all-log_exception_info-calls-with-log.patch new file mode 100644 index 0000000..554cb6b --- /dev/null +++ b/SOURCES/0011-iscsi-Replace-all-log_exception_info-calls-with-log.patch @@ -0,0 +1,53 @@ +From b938e224c41021c19775d8675dc4337f1e10d4e3 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Wed, 1 Dec 2021 16:28:15 +0100 +Subject: [PATCH] iscsi: Replace all log_exception_info calls with log.info + +We don't get any useful information from the exception, it's +always the same traceback from a failed DBus call and we only use +these when a called failed because firmware ISCSI is not supported. +The resulting log message also looks like a failure with the +traceback logged and not just as a debug information. + +Resolves: rhbz#2028134 +--- + blivet/iscsi.py | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/blivet/iscsi.py b/blivet/iscsi.py +index 5ee2082b..bc77ca62 100644 +--- a/blivet/iscsi.py ++++ b/blivet/iscsi.py +@@ -22,7 +22,6 @@ from . import udev + from . import util + from .flags import flags + from .i18n import _ +-from .storage_log import log_exception_info + from . import safe_dbus + import os + import re +@@ -277,8 +276,8 @@ class iSCSI(object): + 'org.freedesktop.DBus.ObjectManager', + 'GetManagedObjects', + None)[0] +- except safe_dbus.DBusCallError: +- log_exception_info(log.info, "iscsi: Failed to get active sessions.") ++ except safe_dbus.DBusCallError as e: ++ log.info("iscsi: Failed to get active sessions: %s", str(e)) + return [] + + sessions = (obj for obj in objects.keys() if re.match(r'.*/iscsi/session[0-9]+$', obj)) +@@ -302,8 +301,8 @@ class iSCSI(object): + args = GLib.Variant("(a{sv})", ([], )) + try: + found_nodes, _n_nodes = self._call_initiator_method("DiscoverFirmware", args) +- except safe_dbus.DBusCallError: +- log_exception_info(log.info, "iscsi: No IBFT info found.") ++ except safe_dbus.DBusCallError as e: ++ log.info("iscsi: No IBFT info found: %s", str(e)) + # an exception here means there is no ibft firmware, just return + return + +-- +2.31.1 + diff --git a/SOURCES/0009-PO-update.patch b/SOURCES/0012-PO-update.patch similarity index 100% rename from SOURCES/0009-PO-update.patch rename to SOURCES/0012-PO-update.patch diff --git a/SPECS/python-blivet.spec b/SPECS/python-blivet.spec index d97460f..cddd80b 100644 --- a/SPECS/python-blivet.spec +++ b/SPECS/python-blivet.spec @@ -23,7 +23,7 @@ Version: 3.4.0 #%%global prerelease .b2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 6%{?prerelease}%{?dist} +Release: 9%{?prerelease}%{?dist} Epoch: 1 License: LGPLv2+ %global realname blivet @@ -38,7 +38,10 @@ Patch4: 0005-Fix-activating-old-style-LVM-snapshots.patch Patch5: 0006-Fix-resolving-devices-with-names-that-look-like-BIOS.patch Patch6: 0007-Do-not-set-chunk-size-for-RAID1.patch Patch7: 0008-Fix-running-tests-in-gating.patch -Patch8: 0009-PO-update.patch +Patch8: 0009-Improve-error-message-printed-for-missing-dependecie.patch +Patch9: 0010-Use-bigger-chunk-size-for-thinpools-bigger-than-15.8.patch +Patch10: 0011-iscsi-Replace-all-log_exception_info-calls-with-log.patch +Patch11: 0012-PO-update.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -201,9 +204,23 @@ configuration. %endif %changelog -* Mon Sep 13 2021 Vojtech Trefny - 3.4.0-6 -- Localization update for 8.5 - Resolves: rhbz#1962016 +* Thu Jan 10 2022 Vojtech Trefny - 3.4.0-9 +- Translation update + Resolves: rhbz#2003050 + +* Tue Dec 14 2021 ojtech Trefny - 3.4.0-8 +- Replace all log_exception_info calls with log.info + Resolves: rhbz#2028134 + +* Fri Nov 26 2021 Vojtech Trefny - 3.4.0-7 +- Release number bump + Related: rhbz#1988276 + +* Fri Nov 26 2021 Vojtech Trefny - 3.4.0-6 +- Improve error message printed for missing dependecies + Resolves: rhbz#1988276 +- Use bigger chunk size for thinpools bigger than ~15.88 TiB + Resolves: rhbz#1949953 * Wed Aug 4 2021 Vojtech Trefny - 3.4.0-5 - Fix running upstream test suite in gating