Fix crash when scanning degraded/not fully assembled MD arrays

This commit is contained in:
Vojtech Trefny 2024-02-06 09:10:17 +01:00
parent 6fb394db93
commit 5bd5783dc1
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From d5169a83f2428dbe2406881e8928a4418c04a365 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
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

View File

@ -5,7 +5,7 @@ Version: 3.9.0
#%%global prerelease .b2 #%%global prerelease .b2
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
Release: 1%{?prerelease}%{?dist} Release: 2%{?prerelease}%{?dist}
Epoch: 1 Epoch: 1
License: LGPL-2.1-or-later License: LGPL-2.1-or-later
%global realname blivet %global realname blivet
@ -17,6 +17,8 @@ Source1: http://github.com/storaged-project/blivet/archive/%{realname}-%{realver
Patch0: 0001-remove-btrfs-plugin.patch Patch0: 0001-remove-btrfs-plugin.patch
%endif %endif
Patch1: 0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch
# Versions of required components (done so we make sure the buildrequires # Versions of required components (done so we make sure the buildrequires
# match the requires versions of things). # match the requires versions of things).
%global partedver 1.8.1 %global partedver 1.8.1
@ -114,6 +116,9 @@ make DESTDIR=%{buildroot} install
%{python3_sitelib}/* %{python3_sitelib}/*
%changelog %changelog
* Tue Feb 06 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.9.0-2
- Fix crash when scanning degraded/not fully assembled MD arrays
* Wed Jan 31 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.9.0-1 * Wed Jan 31 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.9.0-1
- Fix getting default LVM cache metadata size from libblockdev (vtrefny) - Fix getting default LVM cache metadata size from libblockdev (vtrefny)
- Fix checking for segment type for cache pools (vtrefny) - Fix checking for segment type for cache pools (vtrefny)