diff options
author | NeilBrown <neilb@suse.de> | 2006-05-01 15:15:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-01 21:17:42 -0400 |
commit | df30d0f4ca3c41b60068232d6de9d58be88436f0 (patch) | |
tree | f9ea546b15f0c8908d6248480c7f3dad820a5f5e /drivers/md | |
parent | 235acec78e87a60ace01d1ecb4b87ad1d689715a (diff) |
[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 <neilb@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid10.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 617012bc107a..ddc1dfc4d3d2 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1435,9 +1435,9 @@ static void raid10d(mddev_t *mddev) | |||
1435 | sl--; | 1435 | sl--; |
1436 | d = r10_bio->devs[sl].devnum; | 1436 | d = r10_bio->devs[sl].devnum; |
1437 | rdev = conf->mirrors[d].rdev; | 1437 | rdev = conf->mirrors[d].rdev; |
1438 | atomic_add(s, &rdev->corrected_errors); | ||
1439 | if (rdev && | 1438 | if (rdev && |
1440 | test_bit(In_sync, &rdev->flags)) { | 1439 | test_bit(In_sync, &rdev->flags)) { |
1440 | atomic_add(s, &rdev->corrected_errors); | ||
1441 | if (sync_page_io(rdev->bdev, | 1441 | if (sync_page_io(rdev->bdev, |
1442 | r10_bio->devs[sl].addr + | 1442 | r10_bio->devs[sl].addr + |
1443 | sect + rdev->data_offset, | 1443 | sect + rdev->data_offset, |