diff options
-rw-r--r-- | drivers/md/raid5.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index f31882c1197a..4a7be455d6d8 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -1887,8 +1887,15 @@ static void raid5_end_write_request(struct bio *bi, int error) &rdev->mddev->recovery); } else if (is_badblock(rdev, sh->sector, STRIPE_SECTORS, - &first_bad, &bad_sectors)) + &first_bad, &bad_sectors)) { set_bit(R5_MadeGood, &sh->dev[i].flags); + if (test_bit(R5_ReadError, &sh->dev[i].flags)) + /* That was a successful write so make + * sure it looks like we already did + * a re-write. + */ + set_bit(R5_ReWrite, &sh->dev[i].flags); + } } rdev_dec_pending(rdev, conf->mddev); |