]> git.ipfire.org Git - thirdparty/mdadm.git/commit - Incremental.c
Incremental: remove external arrays and devices correctly
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Fri, 3 Aug 2018 07:41:50 +0000 (09:41 +0200)
committerJes Sorensen <jsorensen@fb.com>
Fri, 3 Aug 2018 14:25:12 +0000 (10:25 -0400)
commitcb8f5371352f6c16af5aab8a40861e13aa50fc2b
tree118c3bc0b85c26e7ba958548f9f8e8c40194523b
parent84d88fd885de05a5f126a1f3661687c541001e39
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>
Incremental.c