Incremental: remove external arrays and devices correctly

Kernel returns EBUSY when device fail invokes array fail.
In external metadata if kernel returns it, mdadm doesn't stop member
arrays but it will try to stop container directly. It fails because
container still has working arrays, so udev remove is triggered.

Try to set faulty state on device in member arrays first. If kernel
returns EBUSY, stop this array. After that remove the device from
container.

In external metadata mdmon has to remove faulty devices from degraded
arrays, just remove device from container.

Raid5 array doesn't return EBUSY, it allows to remove every device.
Mdadm shouldn't block it.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
1 file changed