md/raid1: add failfast handling for writes.
authorNeilBrown <neilb@suse.com>
Fri, 18 Nov 2016 05:16:12 +0000 (16:16 +1100)
committerShaohua Li <shli@fb.com>
Tue, 22 Nov 2016 17:14:10 +0000 (09:14 -0800)
commit212e7eb7a3403464a796c05c2fc46cae3b62d803
tree8c7cdf4eb6191d1d0210b524eccb9b7e88e2c378
parent2e52d449bcec31cb66d80aa8c798b15f76f1f5e0
md/raid1: add failfast handling for writes.

When writing to a fastfail device we use MD_FASTFAIL unless
it is the only device being written to.

For resync/recovery, assume there was a working device to
read from so always use REQ_FASTFAIL_DEV.

If a write for resync/recovery fails, we just fail the
device - there is not much else to do.

If a normal failfast write fails, but the device cannot be
failed (must be only one left), we queue for write error
handling.  This will call narrow_write_error() to retry the
write synchronously and without any FAILFAST flags.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid1.c