From: Namhyung Kim Date: Wed, 27 Jul 2011 01:00:36 +0000 (+1000) Subject: md/raid5: move rdev->corrected_errors counting X-Git-Tag: v3.1-rc1~131^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddd5115fe5594f5aae3c7f0008a5327bb1d19397;p=platform%2Fkernel%2Flinux-3.10.git md/raid5: move rdev->corrected_errors counting Read errors are considered to corrected if write-back and re-read cycle is finished without further problems. Thus moving the rdev-> corrected_errors counting after the re-reading looks more reasonable IMHO. Signed-off-by: Namhyung Kim Signed-off-by: NeilBrown --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 0cd5914..a81eca6 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -547,10 +547,6 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) bi->bi_io_vec[0].bv_offset = 0; bi->bi_size = STRIPE_SIZE; bi->bi_next = NULL; - if ((rw & WRITE) && - test_bit(R5_ReWrite, &sh->dev[i].flags)) - atomic_add(STRIPE_SECTORS, - &rdev->corrected_errors); generic_make_request(bi); } else { if (rw & WRITE) @@ -1590,6 +1586,7 @@ static void raid5_end_read_request(struct bio * bi, int error) (unsigned long long)(sh->sector + rdev->data_offset), bdevname(rdev->bdev, b)); + atomic_add(STRIPE_SECTORS, &rdev->corrected_errors); clear_bit(R5_ReadError, &sh->dev[i].flags); clear_bit(R5_ReWrite, &sh->dev[i].flags); }