diff options
author | Alexander Lyakas <alex.bolshoy@gmail.com> | 2012-07-17 06:17:55 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-07-30 22:01:29 -0400 |
commit | d57368afe63b3b7b45ce6c2b8c5276417935be2f (patch) | |
tree | f9748e1f4ecd42a416e922e3d5890dc32194a4dd /drivers/md | |
parent | 895e3c5c58a80bb9e4e05d9ac38b4f30e0f97d80 (diff) |
md/RAID1: Add missing case for attempting to repair known bad blocks.
When doing resync or repair, attempt to correct bad blocks, according
to WriteErrorSeen policy
Signed-off-by: Alex Lyakas <alex.bolshoy@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d2361b162de5..197f62681db5 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -2445,6 +2445,18 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp | |||
2445 | bio->bi_rw = READ; | 2445 | bio->bi_rw = READ; |
2446 | bio->bi_end_io = end_sync_read; | 2446 | bio->bi_end_io = end_sync_read; |
2447 | read_targets++; | 2447 | read_targets++; |
2448 | } else if (!test_bit(WriteErrorSeen, &rdev->flags) && | ||
2449 | test_bit(MD_RECOVERY_SYNC, &mddev->recovery) && | ||
2450 | !test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) { | ||
2451 | /* | ||
2452 | * The device is suitable for reading (InSync), | ||
2453 | * but has bad block(s) here. Let's try to correct them, | ||
2454 | * if we are doing resync or repair. Otherwise, leave | ||
2455 | * this device alone for this sync request. | ||
2456 | */ | ||
2457 | bio->bi_rw = WRITE; | ||
2458 | bio->bi_end_io = end_sync_write; | ||
2459 | write_targets++; | ||
2448 | } | 2460 | } |
2449 | } | 2461 | } |
2450 | if (bio->bi_end_io) { | 2462 | if (bio->bi_end_io) { |