]> git.ipfire.org Git - thirdparty/mdadm.git/commit - mdadm.h
mdmon: fix wrong array state when disk fails during mdmon startup
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Tue, 7 May 2019 14:08:47 +0000 (16:08 +0200)
committerJes Sorensen <jsorensen@fb.com>
Mon, 20 May 2019 18:14:36 +0000 (14:14 -0400)
commitae7d61e35ec2ab6361c3e509a8db00698ef3396f
tree57b2022d5e91013ba28c65fe9f1615d1384c45ce
parent3c9b46cf9ae15a9be98fc47e2080bd9494496246
mdmon: fix wrong array state when disk fails during mdmon startup

If a member drive disappears and is set faulty by the kernel during
mdmon startup, after ss->load_container() but before manage_new(), mdmon
will try to readd the faulty drive to the array and start rebuilding.
Metadata on the active drive is updated, but the faulty drive is not
removed from the array and is left in a "blocked" state and any write
request to the array will block. If the faulty drive reappears in the
system e.g. after a reboot, the array will not assemble because metadata
on the drives will be incompatible (at least on imsm).

Fix this by adding a new option for sysfs_read(): "GET_DEVS_ALL". This
is an extension for the "GET_DEVS" option and causes all member devices
to be returned, even if the associated block device has been removed.
Use this option in manage_new() to include the faulty device on the
active_array's devices list. Mdmon will then properly remove the faulty
device from the array and update the metadata to reflect the degraded
state.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
managemon.c
mdadm.h
super-intel.c
sysfs.c