summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGioh Kim <gi-oh.kim@profitbricks.com>2018-05-02 13:08:11 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-03 07:47:49 +0200
commit07a43bbfe3c9a320d30f3f1129f5803a7f4fae2a (patch)
treec6fd21221e567295b81e9b5a3929b2bb102170dc
parent02e9f887677c1f4449ebb9c9dc24e09ae2811cb4 (diff)
downloadlinux-stable-07a43bbfe3c9a320d30f3f1129f5803a7f4fae2a.tar.gz
linux-stable-07a43bbfe3c9a320d30f3f1129f5803a7f4fae2a.tar.bz2
linux-stable-07a43bbfe3c9a320d30f3f1129f5803a7f4fae2a.zip
md/raid1: add error handling of read error from FailFast device
[ Upstream commit b33d10624fdc15cdf1495f3f00481afccec76783 ] Current handle_read_error() function calls fix_read_error() only if md device is RW and rdev does not include FailFast flag. It does not handle a read error from a RW device including FailFast flag. I am not sure it is intended. But I found that write IO error sets rdev faulty. The md module should handle the read IO error and write IO error equally. So I think read IO error should set rdev faulty. Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com> Reviewed-by: Jack Wang <jinpu.wang@profitbricks.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/md/raid1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index e9e3308cb0a7..4445179aa4c8 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2474,6 +2474,8 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
fix_read_error(conf, r1_bio->read_disk,
r1_bio->sector, r1_bio->sectors);
unfreeze_array(conf);
+ } else if (mddev->ro == 0 && test_bit(FailFast, &rdev->flags)) {
+ md_error(mddev, rdev);
} else {
r1_bio->bios[r1_bio->read_disk] = IO_BLOCKED;
}