md_monitor: use select when receiving CLI reply

CLI replies have a noticeable delay, as the initial
recvmsg is greeted with an EAGAIN. So better use
select() here to get an instantaneous reply.

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: Display correct action in mdadm_exec_thread()

md_monitor will always display 'all device failed after XXX seconds'
regardless of the actual action.

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: Do not special-case IO_TIMEOUT

IO_TIMEOUT should be handled like any other failure, ie
it should invoke fail_mirror(). If we don't do this we
won't be failing the entire mirror.

References: bnc#808893

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: Set devices to 'FAULTY' on CP DETACH

When calling 'CP DETACH' we should be setting the device
to faulty, as the device itself is still available in the
system. Otherwise the mirror side will not be failed.

References: bnc#808647

Signed-off-by: Hannes Reinecke <hare@suse.de>
monitor_testcase5: fixup test

We need to wait for sync to finish before starting the
next round. And there was a typo disabling detaching of
the right side.

Signed-off-by: Hannes Reinecke <hare@suse.de>
monitor_testcase7: wait for lazy bitmap update

Bitmaps are updated lazy, ie they are not counted when calling
mdadm --wait. But we can only remove empty bitmaps, so we have
to check the bitmap status before removing it.

Signed-off-by: Hannes Reinecke <hare@suse.de>
monitor_testcase8: Fixup testcase

The testcase hasn't been moved to the new disk layout.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Version 4.18

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: remove unused variable 'raid_devt'

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: Add debugging output for mdadm sequencing

Some more debugging output to identify mdadm latency.

References: bnc#808302

Signed-off-by: Hannes Reinecke <hare@suse.de>
md_monitor: Set DASD timeout flag prior to calling mdadm

mdadm relies on all I/O to be aborted before any changes to
the array can be made. So whenever we detect a timeout
situation we should be setting the DASD timeout flag
before calling mdadm. This will ensure that all I/O will be
aborted in a timely manner.

References: bnc#808302

Signed-off-by: Hannes Reinecke <hare@suse.de>
Merge branch 'master' of github.com:/hreinecke/md_monitor