Sync from SUSE:SLFO:Main mdadm revision d99310084a0e4b965424d174a634ba9c

This commit is contained in:
2025-05-19 21:53:24 +02:00
parent 95388a8b76
commit 97560eb6eb
4 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
From 127e38b59cbdf717d1569bcdc75b8d823d8485f3 Mon Sep 17 00:00:00 2001
From: Blazej Kucman <blazej.kucman@intel.com>
Date: Mon, 31 Mar 2025 12:46:52 +0200
Subject: [PATCH] imsm: Fix RAID0 to RAID10 migration
Support for RAID10 with +4 disks in IMSM introduced an inconsistency
between the VROC UEFI driver and Linux IMSM. VROC UEFI does not
support RAID10 with +4 disks, therefore appropriate protections were
added to the mdadm IMSM code that results in skipping processing of
such RAID in the UEFI phase. Unfortunately the case of migration
RAID0 2 disks to RAID10 4 disks was omitted, this case requires
maintaining compatibility with the VROC UEFI driver because it is
supported.
For RAID10 +4 disk the MPB_ATTRIB_RAID10_EXT attribute is set in the
metadata, thanks to which the UEFI driver does not process such RAID.
In the series adding support, a new metadata raid level value
IMSM_T_RAID10 was also introduced. It is not recognized by VROC UEFI.
The issue is caused by the fact that in the case of the mentioned
migration, IMSM_T_RAID10 is entered into the metadata but attribute
MPB_ATTRIB_RAID10_EXT is not entered, which causes an attempt to
process such RAID in the UEFI phase. This situation results in
the platform hang during booting in UEFI phase, this also results in
data loss after failed and interrupted RAID processing in VROC UEFI.
The above situation is result of the update_imsm_raid_level()
function, for the mentioned migration function is executed on a map
with a not yet updated number of disks.
The fix is to explicitly handle migration in the function mentioned
above to maintain compatibility with VROC UEFI driver.
Steps to reproduce:
mdadm -C /dev/md/imsm0 -e imsm -n 2 /dev/nvme[1,2]n1 -R
mdadm -C /dev/md/vol -l 0 -n 2 /dev/nvme[1,2]n1 --assume-clean -R
mdadm -a /dev/md127 /dev/nvme3n1
mdadm -a /dev/md127 /dev/nvme4n1
mdadm -G /dev/md126 -l 10
reboot
Fixes: 27550b13297a ("imsm: add support for literal RAID 10")
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
---
super-intel.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/super-intel.c b/super-intel.c
index 4988eef1..b7b030a2 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -1327,6 +1327,19 @@ static void update_imsm_raid_level(struct imsm_map *map, int new_level)
return;
}
+ /*
+ * RAID0 to RAID10 migration.
+ * Due to the compatibility with VROC UEFI must be maintained, this case must be handled
+ * separately, because the map does not have an updated number of disks.
+ */
+ if (map->raid_level == IMSM_T_RAID0) {
+ if (map->num_members == 2)
+ map->raid_level = IMSM_T_RAID1;
+ else
+ map->raid_level = IMSM_T_RAID10;
+ return;
+ }
+
if (map->num_members == 4) {
if (map->raid_level == IMSM_T_RAID10 || map->raid_level == IMSM_T_RAID1)
return;
--
2.35.3

View File

@@ -0,0 +1,42 @@
From 48319768f534e4655ef66176a95d2355a431d735 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Wed, 30 Apr 2025 21:18:36 +0200
Subject: [PATCH 1007/1008] mdadm: allow any valid minor number in md device
name
Since 25aa732 ("mdadm: numbered names verification"), it is not possible
any more to create arrays /dev/md${N} with N >= 127. The limit has later
been increased to 1024, which is also artificial. The error message printed
by mdadm is misleading, as the problem is not POSIX compatibility here.
# mdadm -C -v /dev/md9999 --name=foo -l1 -n2 /dev/loop0 /dev/loop1
mdadm: Value "/dev/md9999" cannot be set as devname. Reason: Not POSIX compatible.
Given that mdadm creates an array with minor number ${N} if the argument is
/dev/md${N}, the natural limit for the number is the highest minor number
available, which is (1 << MINORBITS) with MINORBITS=20 on Linux.
Fixes: 25aa732 ("mdadm: numbered names verification")
Fixes: f786072 ("mdadm: Increase number limit in md device name to 1024.")
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
util.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util.c b/util.c
index 9fe2d22..0f77521 100644
--- a/util.c
+++ b/util.c
@@ -972,7 +972,8 @@ static bool is_devname_numbered(const char *devname, const char *pref, const int
if (parse_num(&val, devname + pref_len) != 0)
return false;
- if (val > 1024)
+ /* Allow any number that represents a valid minor number */
+ if (val >= (1 << 20))
return false;
return true;
--
2.49.0

View File

@@ -1,3 +1,20 @@
-------------------------------------------------------------------
Wed May 7 15:59:57 UTC 2025 - Martin Wilck <mwilck@suse.com>
- Allow any valid minor name in md device name (bsc#1240789)
* add 1007-mdadm-allow-any-valid-minor-number-in-md-device-name.patch
-------------------------------------------------------------------
Tue May 6 15:54:25 UTC 2025 - Martin Wilck <mwilck@suse.com>
- Add dependency on suse-module-tools for SLE15 (bsc#1242696)
-------------------------------------------------------------------
Thu Apr 10 10:54:06 UTC 2025 - Ales Novak <alnovak@suse.com>
- IMSM RAID0 2 disks to RAID10 4 disks migration fix
add 1006-imsm-Fix-RAID0-to-RAID10-migration.patch (bsc#1241001)
-------------------------------------------------------------------
Tue Mar 4 13:42:52 UTC 2025 - Martin Wilck <mwilck@suse.com>

View File

@@ -31,6 +31,9 @@ BuildRequires: sgmltool
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
%if 0%{?suse_version} < 1550
BuildRequires: suse-module-tools
%endif
PreReq: %fillup_prereq
PreReq: coreutils
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
@@ -48,6 +51,9 @@ Patch1002: 1002-OnCalendar-format-fix-of-mdcheck_start-timer.patch
Patch1003: 1003-mdadm-treat-the-Dell-softraid-array-as-local-array.patch
Patch1004: 1004-call-mdadm_env.sh-from-usr-libexec-mdadm.patch
Patch1005: 1005-mdadm-enable-Intel-Alderlake-RSTe-configuration.patch
Patch1006: 1006-imsm-Fix-RAID0-to-RAID10-migration.patch
Patch1007: 1007-mdadm-allow-any-valid-minor-number-in-md-device-name.patch
%define _udevdir %(pkg-config --variable=udevdir udev)
%define _systemdshutdowndir %{_unitdir}/../system-shutdown