Skip to content

Commit 1b3433c

Browse files
Gioh Kimgregkh
Gioh Kim
authored andcommitted
md/raid1: add error handling of read error from FailFast device
[ Upstream commit b33d106 ] 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 <[email protected]> Reviewed-by: Jack Wang <[email protected]> Signed-off-by: Shaohua Li <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6192b11 commit 1b3433c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/md/raid1.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,6 +2462,8 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
24622462
fix_read_error(conf, r1_bio->read_disk,
24632463
r1_bio->sector, r1_bio->sectors);
24642464
unfreeze_array(conf);
2465+
} else if (mddev->ro == 0 && test_bit(FailFast, &rdev->flags)) {
2466+
md_error(mddev, rdev);
24652467
} else {
24662468
r1_bio->bios[r1_bio->read_disk] = IO_BLOCKED;
24672469
}

0 commit comments

Comments
 (0)