aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-27 21:39:25 -0400
committerNeilBrown <neilb@suse.de>2011-07-27 21:39:25 -0400
commitf84ee364dd15af11cada1e673f94128f62db189e (patch)
treee57fc87130b8bb6958413f39ae51718977540152 /drivers/md/raid10.c
parentbd870a16c5946d86126f7203db3c73b71de0a1d8 (diff)
md/raid10: attempt to fix read errors during resync/check
We already attempt to fix read errors found during normal IO and a 'repair' process. It is best to try to repair them at any time they are found, so move a test so that during sync and check a read error will be corrected by over-writing with good data. If both (all) devices have known bad blocks in the sync section we won't try to fix even though the bad blocks might not overlap. That should be considered later. Also if we hit a read error during recovery we don't try to fix it. It would only be possible to fix if there were at least three copies of data, which is not very common with RAID10. But it should still be considered later. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 909450414c67..10415ddfcb42 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1541,11 +1541,12 @@ static void sync_request_write(mddev_t *mddev, r10bio_t *r10_bio)
1541 if (j == vcnt) 1541 if (j == vcnt)
1542 continue; 1542 continue;
1543 mddev->resync_mismatches += r10_bio->sectors; 1543 mddev->resync_mismatches += r10_bio->sectors;
1544 if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery))
1545 /* Don't fix anything. */
1546 continue;
1544 } 1547 }
1545 if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) 1548 /* Ok, we need to write this bio, either to correct an
1546 /* Don't fix anything. */ 1549 * inconsistency or to correct an unreadable block.
1547 continue;
1548 /* Ok, we need to write this bio
1549 * First we need to fixup bv_offset, bv_len and 1550 * First we need to fixup bv_offset, bv_len and
1550 * bi_vecs, as the read request might have corrupted these 1551 * bi_vecs, as the read request might have corrupted these
1551 */ 1552 */