Skip to content

Commit b76b471

Browse files
ncroxonliu-song-6
authored andcommitted
raid5: don't increment read_errors on EILSEQ return
While MD continues to count read errors returned by the lower layer. If those errors are -EILSEQ, instead of -EIO, it should NOT increase the read_errors count. When RAID6 is set up on dm-integrity target that detects massive corruption, the leg will be ejected from the array. Even if the issue is correctable with a sector re-write and the array has necessary redundancy to correct it. The leg is ejected because it runs up the rdev->read_errors beyond conf->max_nr_stripes. The return status in dm-drypt when there is a data integrity error is -EILSEQ (BLK_STS_PROTECTION). Signed-off-by: Nigel Croxon <[email protected]> Signed-off-by: Song Liu <[email protected]>
1 parent 21fa100 commit b76b471

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/md/raid5.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,8 @@ static void raid5_end_read_request(struct bio * bi)
25262526
int set_bad = 0;
25272527

25282528
clear_bit(R5_UPTODATE, &sh->dev[i].flags);
2529-
atomic_inc(&rdev->read_errors);
2529+
if (!(bi->bi_status == BLK_STS_PROTECTION))
2530+
atomic_inc(&rdev->read_errors);
25302531
if (test_bit(R5_ReadRepl, &sh->dev[i].flags))
25312532
pr_warn_ratelimited(
25322533
"md/raid:%s: read error on replacement device (sector %llu on %s).\n",

0 commit comments

Comments
 (0)