aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 201dc7168a5f..9e658e519a27 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1122,9 +1122,13 @@ static int end_sync_read(struct bio *bio, unsigned int bytes_done, int error)
1122 1122
1123 if (test_bit(BIO_UPTODATE, &bio->bi_flags)) 1123 if (test_bit(BIO_UPTODATE, &bio->bi_flags))
1124 set_bit(R10BIO_Uptodate, &r10_bio->state); 1124 set_bit(R10BIO_Uptodate, &r10_bio->state);
1125 else if (!test_bit(MD_RECOVERY_SYNC, &conf->mddev->recovery)) 1125 else {
1126 md_error(r10_bio->mddev, 1126 atomic_add(r10_bio->sectors,
1127 conf->mirrors[d].rdev); 1127 &conf->mirrors[d].rdev->corrected_errors);
1128 if (!test_bit(MD_RECOVERY_SYNC, &conf->mddev->recovery))
1129 md_error(r10_bio->mddev,
1130 conf->mirrors[d].rdev);
1131 }
1128 1132
1129 /* for reconstruct, we always reschedule after a read. 1133 /* for reconstruct, we always reschedule after a read.
1130 * for resync, only after all reads 1134 * for resync, only after all reads
@@ -1430,6 +1434,7 @@ static void raid10d(mddev_t *mddev)
1430 sl--; 1434 sl--;
1431 d = r10_bio->devs[sl].devnum; 1435 d = r10_bio->devs[sl].devnum;
1432 rdev = conf->mirrors[d].rdev; 1436 rdev = conf->mirrors[d].rdev;
1437 atomic_add(s, &rdev->corrected_errors);
1433 if (rdev && 1438 if (rdev &&
1434 test_bit(In_sync, &rdev->flags)) { 1439 test_bit(In_sync, &rdev->flags)) {
1435 if (sync_page_io(rdev->bdev, 1440 if (sync_page_io(rdev->bdev,