From 37f94ce7266457a8d8b463edbebacd9bcedfd183 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 1 May 2006 12:15:44 -0700 Subject: [PATCH] [PATCH] md: Avoid oops when attempting to fix read errors on raid10 We should add to the counter for the rdev *after* checking if the rdev is NULL!!! Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman Signed-off-by: Chris Wright --- drivers/md/raid10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index ab90a6d12020..039ed49b3c03 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1436,9 +1436,9 @@ static void raid10d(mddev_t *mddev) sl--; d = r10_bio->devs[sl].devnum; rdev = conf->mirrors[d].rdev; - atomic_add(s, &rdev->corrected_errors); if (rdev && test_bit(In_sync, &rdev->flags)) { + atomic_add(s, &rdev->corrected_errors); if (sync_page_io(rdev->bdev, r10_bio->devs[sl].addr + sect + rdev->data_offset, -- 2.39.5