From 5bd5783dc1819c59f930f26469f38350e38dbbc1 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Tue, 6 Feb 2024 09:10:17 +0100 Subject: [PATCH] Fix crash when scanning degraded/not fully assembled MD arrays --- ...canning-degraded-not-fully-assembled.patch | 30 +++++++++++++++++++ python-blivet.spec | 7 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch diff --git a/0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch b/0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch new file mode 100644 index 0000000..ebbd2c1 --- /dev/null +++ b/0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch @@ -0,0 +1,30 @@ +From d5169a83f2428dbe2406881e8928a4418c04a365 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Fri, 2 Feb 2024 12:05:15 +0100 +Subject: [PATCH] Fix crash when scanning degraded/not fully assembled MD + arrays + +When we don't have the array name we cannot construct device ID +for the devicetree lookup, we need to let the code fallback to +other means like UUID. +--- + blivet/populator/helpers/mdraid.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/blivet/populator/helpers/mdraid.py b/blivet/populator/helpers/mdraid.py +index 6d66b0c0..22ca5195 100644 +--- a/blivet/populator/helpers/mdraid.py ++++ b/blivet/populator/helpers/mdraid.py +@@ -58,7 +58,8 @@ class MDDevicePopulator(DevicePopulator): + return None + + # try to get the device again now that we've got all the parents +- device = self._devicetree.get_device_by_device_id("MDRAID-" + name, incomplete=flags.allow_imperfect_devices) ++ if name: ++ device = self._devicetree.get_device_by_device_id("MDRAID-" + name, incomplete=flags.allow_imperfect_devices) + + if device is None: + try: +-- +2.43.0 + diff --git a/python-blivet.spec b/python-blivet.spec index 046ef18..8181415 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -5,7 +5,7 @@ Version: 3.9.0 #%%global prerelease .b2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 -Release: 1%{?prerelease}%{?dist} +Release: 2%{?prerelease}%{?dist} Epoch: 1 License: LGPL-2.1-or-later %global realname blivet @@ -17,6 +17,8 @@ Source1: http://github.com/storaged-project/blivet/archive/%{realname}-%{realver Patch0: 0001-remove-btrfs-plugin.patch %endif +Patch1: 0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch + # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). %global partedver 1.8.1 @@ -114,6 +116,9 @@ make DESTDIR=%{buildroot} install %{python3_sitelib}/* %changelog +* Tue Feb 06 2024 Vojtech Trefny - 3.9.0-2 +- Fix crash when scanning degraded/not fully assembled MD arrays + * Wed Jan 31 2024 Vojtech Trefny - 3.9.0-1 - Fix getting default LVM cache metadata size from libblockdev (vtrefny) - Fix checking for segment type for cache pools (vtrefny)