diff options
-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) { |