]> git.ipfire.org Git - thirdparty/mdadm.git/log
thirdparty/mdadm.git
5 months agosuper-ddf: Prevent crash when handling DDF metadata
lilinzhe [Mon, 16 Dec 2024 04:00:02 +0000 (12:00 +0800)] 
super-ddf: Prevent crash when handling DDF metadata

A dummy function is defined because availability of ss->update_super is
not always verified.

This fix addresses a crash reported when assembling a RAID array using
mdadm with DDF metadata. For more details, see the discussion at:
https://lore.kernel.org/all/
CALHdMH30LuxR4tz9jP2ykDaDJtZ3P7L3LrZ+9e4Fq=Q6NwSM=Q@mail.gmail.com/

The discussion centers on an issue with mdadm where attempting to
assemble a RAID array caused a null pointer dereference. The problem
was traced to a missing update_super() function in super-ddf.c, which
led to a crash in Assemble.c.

Signed-off-by: lilinzhe <llz@antiy.cn>
5 months agoplatform-intel: Disable legacy option ROM scan on UEFI machines
Ross Lagerwall [Wed, 29 Jan 2025 13:31:11 +0000 (13:31 +0000)] 
platform-intel: Disable legacy option ROM scan on UEFI machines

The legacy option ROM memory range from 0xc0000-0xeffff is not defined
on UEFI machines so don't attempt to scan it. This avoids lockdown log
spam when Secure Boot is enabled (avoids use of /dev/mem).

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
6 months agomdadm: fix --grow with --add for linear
Yu Kuai [Fri, 27 Dec 2024 06:07:02 +0000 (14:07 +0800)] 
mdadm: fix --grow with --add for linear

For the case mdadm --grow with --add, the s.btype should not be
initialized yet, hence BitmapUnknown should be checked instead of
BitmapNone.

Noted that this behaviour should only support by md-linear, which is
removed from kernel, howerver, it turns out md-linear is used widely
in home NAS and we're planning to reintroduce it soon.

Fixes: 581ba1341017 ("mdadm: remove bitmap file support")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>
6 months agoudev: persist properties of MD devices after switch_root
Antonio Alvarez Feijoo [Thu, 23 Jan 2025 18:46:38 +0000 (19:46 +0100)] 
udev: persist properties of MD devices after switch_root

dracut installs in the initrd a custom udev rule for MD devices
(59-persistent-storage-md.rules) only to set the db_persist option (see
[1]). The main purpose is that if an MD device is activated in the initrd,
its properties are kept on the udev database after the transition from the
initrd to the rootfs. This was added to fix detection issues when LVM is
on top.

This patch would allow to remove the custom udev rule shipped by dracut
(63-md-raid-arrays.rules is already being installed in the initrd), and it
will also benefit other initrd generators that do not want to create
custom udev rules.

[1] https://github.com/dracutdevs/dracut/blob/master/modules.d/90mdraid

Signed-off-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
6 months agomdopen: add sbin path to env PATH when call system("modprobe md_mod")
Coly Li [Wed, 22 Jan 2025 15:18:59 +0000 (23:18 +0800)] 
mdopen: add sbin path to env PATH when call system("modprobe md_mod")

During the boot process if mdadm is called in udev context, sbin paths
like /sbin, /usr/sbin, /usr/local/sbin normally not defined in PATH env
variable, calling system("modprobe md_mod") in create_named_array() may
fail with 'sh: modprobe: command not found' error message.

We don't want to move modprobe binary into udev private directory, so
setting the PATH env is a more proper method to avoid the above issue.

This patch sets PATH env variable with "/sbin:/usr/sbin:/usr/local/sbin"
before calling system("modprobe md_mod"). The change only takes effect
within the udev worker context, not seen by global udev environment.

Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>
6 months agomdadm/raid6check: add xmalloc.h to raid6check.c
Xiao Ni [Fri, 17 Jan 2025 07:15:40 +0000 (15:15 +0800)] 
mdadm/raid6check: add xmalloc.h to raid6check.c

It reports building error:
raid6check.c:324:26: error: implicit declaration of function xmalloc

Add xmalloc.h to raid6check.c file to fix this.

Signed-off-by: Xiao Ni <xni@redhat.com>
Link: https://lore.kernel.org/r/20250117071540.4094-1-xni@redhat.com
Signed-off-by: Song Liu <song@kernel.org>
6 months agoRefactor continue_via_systemd()
Mateusz Kusiak [Wed, 20 Nov 2024 19:01:30 +0000 (19:01 +0000)] 
Refactor continue_via_systemd()

Refactor continue_via_systemd() and it's calls to make it more readable.
No functional changes.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
6 months agoBetter error messages for broken reshape
Mateusz Kusiak [Thu, 10 Oct 2024 12:45:11 +0000 (12:45 +0000)] 
Better error messages for broken reshape

mdadm --grow --continue has no functionality to restore critical sectors
if reshape was stopped during operation. This functionality belongs to
assemble or incremental.

This patch adds hints to error messages, to try to reassemble array in
case of reshape failure to restore critical sector, so assemble can
handle restoration.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
6 months agomdadm: Do not start reshape before switchroot
Mateusz Kusiak [Thu, 10 Oct 2024 10:31:06 +0000 (10:31 +0000)] 
mdadm: Do not start reshape before switchroot

There are numerous issues for --grow --continue in switchroot phrase,
they include:
* Events being missed for restarting grow-continue service. This is
  apparent mostly on OS on RAID scenarios. When a checkpoint (next step)
  is committed, we have no reliable way to gracefully stop reshape until
  it reaches that checkpoint. During boot, there's heavy I/O utilisation,
  which causes sync speed drop, and naturally checkpoint takes longer to
  reach. This further causes systemd to forcefully kill grow-continue
  service due to timeouts, which results in udev event being missed for
  grow-continue service restart.
* Grow-continue (seemingly) was not designed to be restarted without
  reassembly, some things like stopping chunksize (to lower) migration
  were straight up not working until recently.
This patch makes grow-continue (actual reshape) start after switchroot
phrase. This way we should not encounter issues related to restarting
the service.

Add checks not start a reshape if in initrd, let it initialise only.
Change grow-continue udev rule to be triggered whenever there's a
reshape happening in metadata, rely on udev event to kick reshape after
switchroot. Add handle_forking helper function for reshapes to avoid
duplicating code.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
6 months agoDetail: Export reshape status
Mateusz Kusiak [Wed, 9 Oct 2024 11:24:13 +0000 (11:24 +0000)] 
Detail: Export reshape status

Display if there's an ongoing reshape happening in mdadm --detail
--export output.

This change is needed for incoming patches that will change "grow
continue" udev rules, to be based on actual array state.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
6 months agoRemove --freeze-reshape logic
Mateusz Kusiak [Wed, 16 Oct 2024 10:48:08 +0000 (10:48 +0000)] 
Remove --freeze-reshape logic

This commit removes --freeze-reshape logic, it basicaly reverts
commit b76b30e0f950 ("Do not continue reshape during initrd phase").
--freeze-reshape was supposed to be used to restore critical sector in
incremental and assemble operations without starting a reshape process,
but it's meaning has been lost through the years and it is not
currently used.

A replacement for this logic will be added in incoming patches, so
reshapes won't be started in initrd phrase.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
6 months agomdadm.man: Remove external bitmap
Mariusz Tkaczyk [Tue, 7 Jan 2025 09:09:16 +0000 (10:09 +0100)] 
mdadm.man: Remove external bitmap

Remove  external bitmap support from manual.

Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>
6 months agomdadm: add MAINTAINERS file
Nigel Croxon [Thu, 9 Jan 2025 20:09:51 +0000 (15:09 -0500)] 
mdadm: add MAINTAINERS file

Create a maintainers file to keep track of people
to contact when dealing with mdadm questions/issues.

Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
7 months agocheckpatch.conf: ignore NEW_TYPEDEFS
Mariusz Tkaczyk [Tue, 12 Nov 2024 13:05:11 +0000 (14:05 +0100)] 
checkpatch.conf: ignore NEW_TYPEDEFS

In mdadm, we have more flexible apporach to typedefs.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agoIncremental: Simplify remove logic
Mariusz Tkaczyk [Tue, 5 Nov 2024 12:07:16 +0000 (13:07 +0100)] 
Incremental: Simplify remove logic

Incremental_remove() does not execute Manage_subdevs() now.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agosysfs: functions for writing md/<memb>/state
Mariusz Tkaczyk [Mon, 4 Nov 2024 14:08:30 +0000 (15:08 +0100)] 
sysfs: functions for writing md/<memb>/state

Add dedicated enum to reflect possible values for mentioned file.
Not all values are mapped. Add map to present sysfs keywords.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agoIncremental: Document workaround
Mariusz Tkaczyk [Mon, 4 Nov 2024 10:37:41 +0000 (11:37 +0100)] 
Incremental: Document workaround

Keep it documented in code.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agoCoverity fixes resources leaks
Nigel Croxon [Mon, 4 Nov 2024 16:17:46 +0000 (11:17 -0500)] 
Coverity fixes resources leaks

Handle variable going out of scope leaks the handle.

Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
7 months agoRelease mdadm-4.4 mdadm-4.4
Mariusz Tkaczyk [Thu, 7 Nov 2024 08:30:19 +0000 (09:30 +0100)] 
Release mdadm-4.4

Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>
7 months agotests: increase sleeps from 1s to 2s
Mateusz Kusiak [Thu, 12 Dec 2024 18:15:09 +0000 (19:15 +0100)] 
tests: increase sleeps from 1s to 2s

The issue here is that some of the tests sporadically fail due to things
being still processed. Default 1s delays proven not to be sufficient for
newly created CI, as tests tend to ocassionally fail.

This patch increases default 1s sleep to 2s, to hopefully get rid of
sporadical fails.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: increase sleeps for 04r5swap and 05r tests
Mateusz Kusiak [Thu, 12 Dec 2024 13:41:40 +0000 (14:41 +0100)] 
tests: increase sleeps for 04r5swap and 05r tests

This commit increases sleep times from 4 seconds to 6 as some of the
tests seem to be randomly failing due to this.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix 01r5fail
Mateusz Kusiak [Thu, 12 Dec 2024 09:49:39 +0000 (10:49 +0100)] 
tests: fix 01r5fail

Increase sleep to 2s to give driver more time to stop recovery.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix 05r1-re-add-nosuper
Mateusz Kusiak [Fri, 6 Dec 2024 11:48:04 +0000 (12:48 +0100)] 
tests: fix 05r1-re-add-nosuper

Add one second sleep before calling check() for array to process.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix 07autoassemble
Mateusz Kusiak [Thu, 5 Dec 2024 09:03:03 +0000 (10:03 +0100)] 
tests: fix 07autoassemble

Block device check in testdev() is not sufficient as it does not account
for symlinks. Fix the check to use lsblk instead. Add mdstat check for
better debugging TC and change md0 for md127 as that will be array name
after assembly.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix 07autodetect
Mateusz Kusiak [Thu, 5 Dec 2024 08:52:35 +0000 (09:52 +0100)] 
tests: fix 07autodetect

Change graceful exit to skip to indicate the test cannot be run.
Add some sleep after creation, let's see if that's enough.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: mark 07changelevels broken
Mateusz Kusiak [Thu, 5 Dec 2024 08:35:41 +0000 (09:35 +0100)] 
tests: mark 07changelevels broken

Test 07changelevels can fail in multiple ways:
- R5 -> R6 migration can make driver unresponsive
- R6 -> R5 migration can fail

Mark the test as broken to clear the CI.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix 07layouts
Mateusz Kusiak [Wed, 4 Dec 2024 11:03:29 +0000 (12:03 +0100)] 
tests: fix 07layouts

Remove redundant backup file creation so mdadm does not complain it
already exists.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: remove redundant new-line from save_log()
Mateusz Kusiak [Tue, 3 Dec 2024 10:35:29 +0000 (11:35 +0100)] 
tests: remove redundant new-line from save_log()

Remove redundant new-line character from "echo" call in save_log().

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: skip 07testreshape5 if no test_stripe
Mateusz Kusiak [Tue, 3 Dec 2024 10:32:18 +0000 (11:32 +0100)] 
tests: skip 07testreshape5 if no test_stripe

For test 07testreshape5 to succeed test_stripe binary must be first
compiled. Add check to skip test if no binary.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix 09imsm-assemble
Mateusz Kusiak [Tue, 3 Dec 2024 10:05:56 +0000 (11:05 +0100)] 
tests: fix 09imsm-assemble

Refactor imsm_check_removal() to give mdadm a chance to remove the
device, add retries.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix 10ddf-create
Mateusz Kusiak [Tue, 3 Dec 2024 09:17:23 +0000 (10:17 +0100)] 
tests: fix 10ddf-create

There are two issues with 10ddf-create:
- get_rootdev() failed if test was run in VM. Simplify and refactor the
function.
- tests fails at assemble due to segfault. Mark test as broken to clear
  the CI.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix 24raid10deadlock
Mateusz Kusiak [Mon, 2 Dec 2024 11:37:03 +0000 (12:37 +0100)] 
tests: fix 24raid10deadlock

Skip tests if fault injection is not enabled.
Remove 24raid10deadlock.inject_error empty file.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: add skip option
Mateusz Kusiak [Mon, 2 Dec 2024 11:35:01 +0000 (12:35 +0100)] 
tests: add skip option

As for now the test either fails or succeeds. Add third option: skip.
This is to be used for tests that might not be possible to execute for
example due to missing (software) components or kernel not being
compiled with debugging options.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agotests: fix tests 25raid246
Mateusz Kusiak [Mon, 2 Dec 2024 09:17:34 +0000 (10:17 +0100)] 
tests: fix tests 25raid246

This commit fixes tests 25raid246 so CI can pass.
Details:
- Change array size to 10M.
- Change filesystem from xfc to ext4 (more distros should have toolset
  out of the box).
- Mark 25raid456-reshape-while-recovery as broken. It's too much effort
  to fix it for now.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
7 months agomdadm: remove bitmap file support
Yu Kuai [Mon, 2 Dec 2024 01:59:13 +0000 (09:59 +0800)] 
mdadm: remove bitmap file support

Because it's marked deprecated for a long time now, and it's not worthy
to support it for new bitmap.

Now that we don't need to store filename for bitmap, also declare a new
enum type bitmap_type to simplify code.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agomdadm: ask user if bitmap is not set
Yu Kuai [Mon, 2 Dec 2024 01:59:12 +0000 (09:59 +0800)] 
mdadm: ask user if bitmap is not set

Instead of auto-forcing bitmap only for large arrays, it is more
reasonable to let user do the chooice if bimtap is not set.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agoManage: forbid re-add to the array without metadata
Yu Kuai [Mon, 2 Dec 2024 01:59:11 +0000 (09:59 +0800)] 
Manage: forbid re-add to the array without metadata

For the build mode or external metadata, re-add is not supported,
because it will not trigger full disk recovery, user should add a new disk
to the array instead.

Also update test/05r1-re-add-nosuper to reflect this.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agotests/05r1-re-add-nosuper: remove bitmap file test
Yu Kuai [Mon, 2 Dec 2024 01:59:10 +0000 (09:59 +0800)] 
tests/05r1-re-add-nosuper: remove bitmap file test

Prepare to remove bitmap file support.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agotests/04update-uuid: remove bitmap file test
Yu Kuai [Mon, 2 Dec 2024 01:59:09 +0000 (09:59 +0800)] 
tests/04update-uuid: remove bitmap file test

Prepare to remove the bitmap file support.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
7 months agotest: Fix saving artifacts
Mariusz Tkaczyk [Fri, 29 Nov 2024 08:48:03 +0000 (09:48 +0100)] 
test: Fix saving artifacts

Currently, if error is returned by test command, execution of other
steps is aborted. In that case, continue-on-error safe artifact but
return error later and fail the job.

If executions passed, there are no artifacts to safe, therefore do not
safe them.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agotest: return fail if any failed
Mariusz Tkaczyk [Tue, 26 Nov 2024 08:36:38 +0000 (09:36 +0100)] 
test: return fail if any failed

GH action status should be failed if any test failed.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agotest: Log execution time
Mariusz Tkaczyk [Mon, 25 Nov 2024 09:17:15 +0000 (10:17 +0100)] 
test: Log execution time

To start optymalizing test suite, we need to know which tests are the
most time consuming. Log execution time after every test.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agoimsm: fix tpv drvies check in add_to_super
Blazej Kucman [Wed, 20 Nov 2024 15:50:25 +0000 (16:50 +0100)] 
imsm: fix tpv drvies check in add_to_super

Before the mentioned patch, the check to verify if IMSM on current
platform supports a use of TPV (other than Intel) disk, was only performed
for non-Intel disks, after it is performed for all. This change causes
inability to use any disk when platform does not support TPV drives,
attempt results in the following error.

mdadm:  Platform configuration does not support non-Intel NVMe drives.
        Please refer to Intel(R) RSTe/VROC user guide.

This change restores the check if the disk is non-Intel.

Fixes: 734e7db4dfc5 ("imsm: Remove warning and refactor add_to_super_imsm code")
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
8 months agotests: fix "foreign" verification for nameing tests.
Mariusz Tkaczyk [Fri, 22 Nov 2024 09:27:35 +0000 (10:27 +0100)] 
tests: fix "foreign" verification for nameing tests.

Mdadm supports DEVNODE in multiple form, we cannot trust that because it
does not always reflect name in metadata. Tests are defining clear
expectations- we must use them.

Do foreign verification against WANTED_NAME instead of passed DEVNODE.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agoplatform-intel: fix buffer overflow
Blazej Kucman [Fri, 22 Nov 2024 10:01:04 +0000 (11:01 +0100)] 
platform-intel: fix buffer overflow

mdadm -C /dev/md/imsm0 -e imsm -n 2 /dev/nvme5n1 /dev/nvme4n1 -R
mdadm -C /dev/md/r0d2 -l 0 -n 2 /dev/nvme5n1 /dev/nvme4n1 -R
*** buffer overflow detected ***: terminated
Aborted (core dumped)

Issue is related to D_FORTIFY_SOURCE=3 flag and depends on environment,
especially compiler version. In function active_arrays_by_format length of
path buffer is calculated dynamically based on parameters, while PATH_MAX
is used in snprintf, this is my lead to buffer overflow.

It is fixed by change dynamic length calculation, to use define PATH_MAX
for path length.

Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
8 months agoCI: run mdadm tests on test scripts change
Kinga Stefaniuk [Fri, 22 Nov 2024 09:37:16 +0000 (10:37 +0100)] 
CI: run mdadm tests on test scripts change

Run mdadm tests scope on every change related to test files.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
8 months agodebug: add timestamps for debug messages
Mateusz Kusiak [Wed, 20 Nov 2024 17:20:32 +0000 (17:20 +0000)] 
debug: add timestamps for debug messages

Timestamps on debug messages help establish what takes long to process.
Debug messages are print only if DDEBUG flag is passed.

Add timestamps for debug messages. Remove dead code from dprintf dummies
for non-debug builds. Remove timestamps from current debug messages.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
8 months agoCI: assign ret to numeric value
Kinga Stefaniuk [Fri, 15 Nov 2024 13:32:00 +0000 (14:32 +0100)] 
CI: assign ret to numeric value

Use variable to store tests exit status. Return its value when test
script finished.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
8 months agoREADME: Rephrase mailing list chapter
Mariusz Tkaczyk [Wed, 13 Nov 2024 13:40:33 +0000 (14:40 +0100)] 
README: Rephrase mailing list chapter

As suggested by Dan, make it sounds more welcomed.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agoCI: use self-hosted runner to run tests
Kinga Stefaniuk [Tue, 12 Nov 2024 16:06:38 +0000 (17:06 +0100)] 
CI: use self-hosted runner to run tests

Use prepared VM machine in GitHub actions to run mdadm tests on it.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
8 months agofunc.sh: do not hang when grow-continue can't finish
Kinga Stefaniuk [Thu, 24 Oct 2024 13:09:47 +0000 (15:09 +0200)] 
func.sh: do not hang when grow-continue can't finish

When grow-continue process is ongoing, sync_action indicates that
recovery is in progress. If grow-continue does not finish,
even if sync_action is not "reshape" anymore, the test should fail.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
8 months agoFix 07reshape5initr test
Kinga Stefaniuk [Thu, 10 Oct 2024 06:35:46 +0000 (08:35 +0200)] 
Fix 07reshape5initr test

This test could hang if "check" action is not written to sync_action. If
this value didn't appear, test hanged on infinite while loop. Add 5
second timeout to loop.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
8 months agoimsm: add print license for VMD
Blazej Kucman [Thu, 25 Jul 2024 15:40:12 +0000 (17:40 +0200)] 
imsm: add print license for VMD

Add print IMSM license for VMD controllers in --detail-platform.
The license specifies the scope of RAID support in the platform for
the VMD controller.

Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
8 months agotests: remove --auto
Mariusz Tkaczyk [Tue, 5 Nov 2024 12:44:58 +0000 (13:44 +0100)] 
tests: remove --auto

It is deprecated and it is not tested now.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agomdopen: remove wrong condition
Mariusz Tkaczyk [Wed, 6 Nov 2024 08:53:01 +0000 (09:53 +0100)] 
mdopen: remove wrong condition

After mentioned patch, this condition get opposite meaning and it
is blocking creation in cases where it was supported.

Remove it now.

Fixes: 119cdcad049e ("mdadm: drop auto= support")
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agomdadm.conf: remove refferences to old kernels.
Mariusz Tkaczyk [Mon, 7 Oct 2024 11:42:19 +0000 (13:42 +0200)] 
mdadm.conf: remove refferences to old kernels.

Remove them.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agomd.man: Remove refferences to not supported kernel
Mariusz Tkaczyk [Mon, 7 Oct 2024 11:38:26 +0000 (13:38 +0200)] 
md.man: Remove refferences to not supported kernel

Reader doesn't need it. Remove it.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agomdadm.man: Remove refferences to legacy kernels
Mariusz Tkaczyk [Mon, 7 Oct 2024 11:28:30 +0000 (13:28 +0200)] 
mdadm.man: Remove refferences to legacy kernels

We are not supporting kernels older than 3.10.
Update mdadm man.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agomdadm: drop auto= support
Mariusz Tkaczyk [Mon, 7 Oct 2024 12:20:17 +0000 (14:20 +0200)] 
mdadm: drop auto= support

According to author (and what was described in man):
"With mdadm 3.0, device creation is normally left up to udev so this is
option is unlikely to be needed"
This was a workaround for kernel 2.6 family issues (partitionable and
non-partitionable arrays hell) and I believe we are far away from it now.

I'm not aware of any usage of it, hence it is removed.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agoReadMe: Fix stylistic issues
Mariusz Tkaczyk [Thu, 31 Oct 2024 12:29:01 +0000 (13:29 +0100)] 
ReadMe: Fix stylistic issues

No functional changes, just adopt style to allow checkpatch to pass.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agomdmon: delegate removal to managemon
Mariusz Tkaczyk [Tue, 30 Jul 2024 12:12:21 +0000 (14:12 +0200)] 
mdmon: delegate removal to managemon

Starting from [1], kernel requires suspend lock on member drive remove
path. It causes deadlock with external management because monitor
thread may be locked on suspend and is unable to switch array to active,
for example if badblock is reported in this time.

It is blocking action now, so it must be delegated to managemon thread
but we must ensure that monitor does metadata update first, just after
detecting faulty.

This patch adds appropriative support. Monitor thread detects "faulty",
and updates the metadata. After that, it is asking manager thread to
remove the device. Manager must be careful because closing descriptors
used by select() may lead to abort with D_FORTIFY_SOURCE=2. First, it
must ensure that device descriptors are not used by monitor.

There is unlimited numer of remove retries and recovery is blocked
until all failed drives are removed. It is safe because "faulty"
device is not longer used by MD.

Issue will be also mitigated by optimalization on badlbock recording path
in kernel. It will check if device is not failed before badblock is
recorded but relying on this is not ideologically correct. Userspace
must keep compatibility with kernel and since it is blocking action,
we must tract is as blocking action.

[1] kernel commit cfa078c8b80d ("md: use new apis to suspend array
    for adding/removing rdev from state_store()")

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agomonitor: Add DS_EXTERNAL_BB flag
Mariusz Tkaczyk [Tue, 27 Aug 2024 12:56:57 +0000 (14:56 +0200)] 
monitor: Add DS_EXTERNAL_BB flag

If this is set, then metadata handler must support external badblocks.
Remove checks for superswitch functions. If mdi->state_fd is not set
then we should not try to record badblock, we cannot trust this device.

No functional changes.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
8 months agosysfs: add sysfs_open_memb_attr()
Mariusz Tkaczyk [Mon, 7 Oct 2024 09:45:46 +0000 (11:45 +0200)] 
sysfs: add sysfs_open_memb_attr()

Function is added to not repeat defining "dev-%s", disk_name.
Related code branches are updated. Ioctl way for setting disk
faulty/remove is removed, sysfs is always used now.

Some non functional style issues are fixed in Manage_subdevs().

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
9 months ago[PATCH] mdadm: Grow.c distinguish takeover vs reshape on grow operation
Nigel Croxon [Wed, 23 Oct 2024 12:18:15 +0000 (08:18 -0400)] 
[PATCH] mdadm: Grow.c distinguish takeover vs reshape on grow operation

Correcting the terminology on the output when doing a takeover
vs a reshape.

Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
9 months agomdadm/Grow: Check new_level interface rather than kernel version
Xiao Ni [Fri, 18 Oct 2024 08:48:17 +0000 (16:48 +0800)] 
mdadm/Grow: Check new_level interface rather than kernel version

Different os distributions have different kernel version themselves.
Check new_level sysfs interface rather than kernel version.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
9 months agomdadm/Manage: Clear superblock if adding new device fails
Xiao Ni [Fri, 18 Oct 2024 08:48:16 +0000 (16:48 +0800)] 
mdadm/Manage: Clear superblock if adding new device fails

The superblock is kept if adding new device fails. It should clear the
superblock if it fails to add a new disk.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
9 months agoutil: use only /dev directory in open_dev()
Kinga Stefaniuk [Wed, 9 Oct 2024 06:48:20 +0000 (08:48 +0200)] 
util: use only /dev directory in open_dev()

Previously, open_dev() tried to open device in two ways - using /dev and
/tmp directory. This method could be used by users which have no access
to /tmp directory (e.g. udev) and dev_open() fails which may affect many
processes. Remove try to open in /tmp directory.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
9 months agomdadm.man: Add udev-rules flag
Andre Paiusco [Sat, 12 Oct 2024 14:29:01 +0000 (16:29 +0200)] 
mdadm.man: Add udev-rules flag

--udev-rules flag is added and point to mdadm.conf man page
for further explanations about POLICY.

Signed-off-by: Andre Paiusco <github@paiusco.org>
9 months agomdadm.conf.man: Explain udev rule
Andre Paiusco [Sat, 12 Oct 2024 14:28:29 +0000 (16:28 +0200)] 
mdadm.conf.man: Explain udev rule

Clarify a filename is accepted and the need of reloading the
udev rules.

Small correction on example order.

Signed-off-by: Andre Paiusco <github@paiusco.org>
9 months agomdadm: Add mdadm_status.h
Anna Sztukowska [Wed, 9 Oct 2024 06:14:05 +0000 (08:14 +0200)] 
mdadm: Add mdadm_status.h

Move mdadm_status_t to mdadm_status.h file. Add status for memory
allocation failure.

Signed-off-by: Anna Sztukowska <anna.sztukowska@intel.com>
9 months agomdadm.man: elaborate more about mdmonitor.service
Mariusz Tkaczyk [Tue, 10 Sep 2024 13:35:03 +0000 (15:35 +0200)] 
mdadm.man: elaborate more about mdmonitor.service

Describe how it behaves and how it can be configured to work.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
9 months agomdmonitor: Abandon custom configuration files
Mariusz Tkaczyk [Thu, 26 Sep 2024 07:01:55 +0000 (09:01 +0200)] 
mdmonitor: Abandon custom configuration files

Operating system vendors are customizing mdmonitor service beacause
the default form is not satifying for them (expect SUSE). As a result,
support is complicated (maintainers have to check the system) and man page
is not detailed.

I propose to abandon custom configuration files via sysconfig and keep
it inside mdadm.conf only.

Detailed comment in service for OSV maintainers is added to help with
transition.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
9 months agosuper-intel: move scsi_get_serial from sg_io
Kinga Stefaniuk [Fri, 4 Oct 2024 08:23:57 +0000 (10:23 +0200)] 
super-intel: move scsi_get_serial from sg_io

scsi_get_serial() function is used only by super-intel.c. Move function
to this file and remove sg_io.c file.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
9 months agoRename Monitor.c to mdmonitor.c
Kinga Stefaniuk [Mon, 30 Sep 2024 13:48:11 +0000 (15:48 +0200)] 
Rename Monitor.c to mdmonitor.c

Rename Monitor.c to mdmonitor.c to avoid errors during compilation on
case-insensitive filesystems.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
9 months agoutil: fix sys_hot_remove_disk()
Mariusz Tkaczyk [Fri, 4 Oct 2024 11:57:48 +0000 (13:57 +0200)] 
util: fix sys_hot_remove_disk()

Instead of "remove", "faulty" was called.

Fixes: d95edceb362a ("sysfs: add function for writing to sysfs fd")
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
9 months agomd.man: update refference to raid5-ppl.rst
Mariusz Tkaczyk [Tue, 10 Sep 2024 12:17:58 +0000 (14:17 +0200)] 
md.man: update refference to raid5-ppl.rst

Documentation/md has moved to Documentation/driver-api/md.
Update and and rework sentence.

Remove refference to not supported kernel close to updated text.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm: add xmalloc.h
Mariusz Tkaczyk [Wed, 25 Sep 2024 11:16:10 +0000 (13:16 +0200)] 
mdadm: add xmalloc.h

Move memory declaration helpers outside mdadm.h. They seems to be
useful so keep them but include separatelly. Rework them to not reffer
to Name[] declared internally in mdadm/mdmon.

This is first step to start decomplexing mdadm.h.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agoMdmonitor: Fix startup with missing directory
Anna Sztukowska [Tue, 3 Sep 2024 11:01:04 +0000 (13:01 +0200)] 
Mdmonitor: Fix startup with missing directory

Commit 0a07dea8d3b78 ("Mdmonitor: Refactor check_one_sharer() for
better error handling") introduced an issue, if directory /run/mdadm
is missing, monitor fails to start. Move the directory creation
earlier to ensure it is always created.

Signed-off-by: Anna Sztukowska <anna.sztukowska@intel.com>
10 months agosysfs: add function for writing to sysfs fd
Mariusz Tkaczyk [Tue, 24 Sep 2024 13:53:18 +0000 (15:53 +0200)] 
sysfs: add function for writing to sysfs fd

Proposed function sysfs_wrte_descriptor() unifies error handling for
write() done to sysfs files. Main purpose is to use it with MD sysfs
file but it can be used elsewhere.

No functional changes.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agoIncremental: Rename IncrementalRemove
Mariusz Tkaczyk [Mon, 23 Sep 2024 12:15:31 +0000 (14:15 +0200)] 
Incremental: Rename IncrementalRemove

Rename it to Incremental_remove for better readability.
No functional changes.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agoCI: do not install unnecessary packages
Kinga Stefaniuk [Wed, 25 Sep 2024 12:30:23 +0000 (14:30 +0200)] 
CI: do not install unnecessary packages

Updating all of the packages every time is not needed and costs a lot of
resources. Install only necessary packages and their dependencies.

Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
10 months agoRemove INSTALL and dev/null
Mariusz Tkaczyk [Mon, 23 Sep 2024 09:12:53 +0000 (11:12 +0200)] 
Remove INSTALL and dev/null

INSTALL is not needed because it added to README.md
dev/null was created accidentally.

Remove them.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/Manage: record errno
Xiao Ni [Wed, 11 Sep 2024 08:54:32 +0000 (16:54 +0800)] 
mdadm/Manage: record errno

Sometimes it reports:
mdadm: failed to stop array /dev/md0: Success
It's the reason the errno is reset. So record errno during the loop.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/tests: remove 09imsm-assemble.broken
Xiao Ni [Wed, 11 Sep 2024 08:54:31 +0000 (16:54 +0800)] 
mdadm/tests: remove 09imsm-assemble.broken

09imsm-assemble can run successfully.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/tests: 07testreshape5 fix
Xiao Ni [Wed, 11 Sep 2024 08:54:30 +0000 (16:54 +0800)] 
mdadm/tests: 07testreshape5 fix

Init dir to avoid test failure.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/tests: Remove 07reshape5intr.broken
Xiao Ni [Wed, 11 Sep 2024 08:54:29 +0000 (16:54 +0800)] 
mdadm/tests: Remove 07reshape5intr.broken

07reshape5intr can run successfully now.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/tests: 07changelevels fix
Xiao Ni [Wed, 11 Sep 2024 08:54:28 +0000 (16:54 +0800)] 
mdadm/tests: 07changelevels fix

There are five changes to this case.

1. remove testdev check. It can't work anymore and check if it's a
block device directly.

2. It can't change level and chunk size at the same time

3. Sleep more than 10s before check wait.
The test devices are small. Sometimes it can finish so quickly once
the reshape just starts. mdadm will be stuck before it waits reshape
to start. So the sync speed is limited. And it restores the sync speed
when it waits reshape to finish. It's good for case without backup
file.

It uses systemd service mdadm-grow-continue to monitor reshape
progress when specifying backup file. If reshape finishes so quickly
before it starts monitoring reshape progress, the daemon will be stuck
too. Because reshape_progress is 0 which means the reshape hasn't been
started. So give more time to let service can get right information
from kernel space.

But before getting these information. It needs to suspend array. At
the same time the reshape is running. The kernel reshape daemon will
update metadata 10s. So it needs to limit the sync speed more than 10s
before restoring sync speed. Then systemd service can suspend array
and start monitoring reshape progress.

4. Wait until mdadm-grow-continue service exits
mdadm --wait doesn't wait systemd service. For the case that needs
backup file, systemd service deletes the backup file after reshape
finishes. In this test case, it runs next case when reshape finishes.
And it fails because it can't create backup file because the backup
file exits.

5. Don't reshape from raid5 to raid1. It can't work now.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/tests: wait until level changes
Xiao Ni [Wed, 11 Sep 2024 08:54:27 +0000 (16:54 +0800)] 
mdadm/tests: wait until level changes

check wait waits reshape finishes, but it doesn't wait level changes.
The level change happens in a forked child progress. So we need to
search the child progress and monitor it.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/Grow: sleep a while after removing disk in impose_level
Xiao Ni [Wed, 11 Sep 2024 08:54:26 +0000 (16:54 +0800)] 
mdadm/Grow: sleep a while after removing disk in impose_level

It needs to remove disks when reshaping from raid456 to raid0. In
kernel space it sets MD_RECOVERY_RUNNING. And it will fail to change
level. So wait sometime to let md thread to clear this flag.

This is found by test case 05r6tor0.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/Grow: Can't open raid when running --grow --continue
Xiao Ni [Wed, 11 Sep 2024 08:54:25 +0000 (16:54 +0800)] 
mdadm/Grow: Can't open raid when running --grow --continue

It passes 'array' as devname in Grow_continue. So it fails to
open raid device. Use mdinfo to open raid device.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/Grow: Update reshape_progress to need_back after reshape finishes
Xiao Ni [Wed, 11 Sep 2024 08:54:24 +0000 (16:54 +0800)] 
mdadm/Grow: Update reshape_progress to need_back after reshape finishes

It tries to update data offset when kicking off reshape. If it can't
change data offset, it needs to use child_monitor to monitor reshape
progress and do back up job. And it needs to update reshape_progress
to need_back when reshape finishes. If not, it will be in a infinite
loop.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm/Grow: Update new level when starting reshape
Xiao Ni [Wed, 11 Sep 2024 08:54:23 +0000 (16:54 +0800)] 
mdadm/Grow: Update new level when starting reshape

Reshape needs to specify a backup file when it can't update data offset
of member disks. For this situation, first, it starts reshape and then
it kicks off mdadm-grow-continue service which does backup job and
monitors the reshape process. The service is a new process, so it needs
to read superblock from member disks to get information.

But in the first step, it doesn't update new level in superblock. So
it can't change level after reshape finishes, because the new level is
not right. So records the new level in the first step.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agomdadm: Add compilation process to README.md
Anna Sztukowska [Tue, 6 Aug 2024 08:44:01 +0000 (10:44 +0200)] 
mdadm: Add compilation process to README.md

Add compilation process and dependencies to README.md.

Signed-off-by: Anna Sztukowska <anna.sztukowska@intel.com>
10 months agoDetail.c: Fix divide_by_zero issue
Anna Sztukowska [Mon, 29 Jul 2024 05:47:39 +0000 (07:47 +0200)] 
Detail.c: Fix divide_by_zero issue

Fix divide_by_zero issue reported by SAST analysis in Detail.c when
calling enough() from util.c. Also add missing spaces for better code
readability.

Signed-off-by: Anna Sztukowska <anna.sztukowska@intel.com>
10 months agoIncremental: support devnode in IncrementalRemove.
Mariusz Tkaczyk [Tue, 25 Jun 2024 10:53:46 +0000 (12:53 +0200)] 
Incremental: support devnode in IncrementalRemove.

There are no reasons to keep this interface different than others.
Allow to use devnode but keep old way for backward compatibility.
Method is added to verify that only devnode or kernel name is used.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
10 months agodlink.h: Fix checkpatch warnings for function args
Anna Sztukowska [Mon, 9 Sep 2024 07:36:47 +0000 (09:36 +0200)] 
dlink.h: Fix checkpatch warnings for function args

Checkpatch issued a warning due to missing function argument names.
Add the names to resolve the warnings.

Signed-off-by: Anna Sztukowska <anna.sztukowska@intel.com>
10 months agoExamine.c: Fix memory leaks in Examine()
Anna Sztukowska [Thu, 8 Aug 2024 15:02:38 +0000 (17:02 +0200)] 
Examine.c: Fix memory leaks in Examine()

Fix memory leaks in Examine() reported by SAST analysis. Implement a
method to traverse and free all the nodes of the doubly linked list.
Replace for loop with while loop in order to improve redability of the
code and free allocated memory correctly.

Signed-off-by: Anna Sztukowska <anna.sztukowska@intel.com>
10 months agoimsm: save checkpoint prior to exit
Mateusz Kusiak [Mon, 2 Sep 2024 16:27:56 +0000 (12:27 -0400)] 
imsm: save checkpoint prior to exit

If reshape (eg. chunksize migration) is gracefully stopped via SIGTERM
the checkpoint is not saved and reshape cannot be resumed due to "data
being present in copy area". This is because UNIT_SRC_NORMAL isn't set
if SIGTERM occurred.

Move SIGTERM handling at the end of the loop to allow saving checkpoint
(and state) so reshapes can be properly resumed.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
10 months agomdadm: Increase number limit in md device name to 1024.
Shminderjit Singh [Mon, 26 Aug 2024 10:06:50 +0000 (10:06 +0000)] 
mdadm: Increase number limit in md device name to 1024.

Updated the maximum device number in md device names from 127 to 1024.
The previous limit was causing issues in the automation framework.
This change ensures backward compatibility and allows for future
scalability.

Fixes: 25aa7329141c ("mdadm: numbered names verification")
Signed-off-by: Shminderjit Singh <shminderjit.singh@oracle.com>
11 months agoimsm: add IMSM_OROM_CAPABILITIES_TPV to nvme orom
Mariusz Tkaczyk [Thu, 22 Aug 2024 10:18:06 +0000 (12:18 +0200)] 
imsm: add IMSM_OROM_CAPABILITIES_TPV to nvme orom

Add it to avoid excluding. It has some value for users even if it is
always true for nvme virtual orom.

Rework detail-platform printing code, move printing 3rd party nvmes
to print_imsm_capability (as it should be), but keep it meaningful
only for nvme controllers (NVME and VMD hba types). Pass whole
orom_entry instead of orom there.

Squash code responsible for printing NVME and VMD hbas.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>