]> git.ipfire.org Git - thirdparty/mdadm.git/commit
imsm: Fix RAID0 to RAID10 migration
authorBlazej Kucman <blazej.kucman@intel.com>
Mon, 31 Mar 2025 10:46:52 +0000 (12:46 +0200)
committerNigel Croxon <109605997+ncroxon@users.noreply.github.com>
Tue, 8 Apr 2025 11:23:22 +0000 (07:23 -0400)
commit127e38b59cbdf717d1569bcdc75b8d823d8485f3
tree142b3a38506547c97f6e59aa266e4a138c325fbd
parent4e2e208c8d3e9ba0fae88136d7c4cd0292af73b0
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