]> git.ipfire.org Git - thirdparty/systemd.git/commit
shutdown: get only active md arrays.
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Tue, 29 Mar 2022 10:49:54 +0000 (12:49 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 6 Apr 2022 20:56:40 +0000 (21:56 +0100)
commit3a3b022d2cc112803ea7b9beea98bbcad110368a
tree936b667b1aa3ddd47113d0867bae48a9ea3bda63
parent31cd2dd9060decfb5c1341e2b126d3dde643e02a
shutdown: get only active md arrays.

Current md_list_get() implementation filters all block devices, started from
"md*". This is ambiguous because list could contain:
- partitions created upon md device (mdXpY)
- external metadata container- specific type of md array.

For partitions there is no issue, because they aren't handle STOP_ARRAY
ioctl sent later. It generates misleading errors only.

Second case is more problematic because containers are not locked in kernel.
They are stopped even if container member array is active. For that reason
reboot or shutdown flow could be blocked because metadata manager cannot be
restarted after switch root on shutdown.

Add filters to remove partitions and containers from md_list. Partitions
can be excluded by DEVTYPE. Containers are determined by MD_LEVEL
property, we are excluding all with "container" value.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
src/shutdown/umount.c