diff options
author | NeilBrown <neilb@suse.de> | 2006-01-06 03:20:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:34:09 -0500 |
commit | 4dbcdc751cb25ffca3a8374cbc5ab6de961cc545 (patch) | |
tree | 61d1eb6e35c0eec66e5a8610c1f57b1e6eec135c /drivers/md/raid10.c | |
parent | d9d166c2a9d5d01af34396793950aa695883eed4 (diff) |
[PATCH] md: count corrected read errors per drive
Store this total in superblock (As appropriate), and make it available to
userspace via sysfs.
Signed-off-by: Neil Brown <neilb@suse.de>
Acked-by: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 201dc7168a5f..9e658e519a27 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1122,9 +1122,13 @@ static int end_sync_read(struct bio *bio, unsigned int bytes_done, int error) | |||
1122 | 1122 | ||
1123 | if (test_bit(BIO_UPTODATE, &bio->bi_flags)) | 1123 | if (test_bit(BIO_UPTODATE, &bio->bi_flags)) |
1124 | set_bit(R10BIO_Uptodate, &r10_bio->state); | 1124 | set_bit(R10BIO_Uptodate, &r10_bio->state); |
1125 | else if (!test_bit(MD_RECOVERY_SYNC, &conf->mddev->recovery)) | 1125 | else { |
1126 | md_error(r10_bio->mddev, | 1126 | atomic_add(r10_bio->sectors, |
1127 | conf->mirrors[d].rdev); | 1127 | &conf->mirrors[d].rdev->corrected_errors); |
1128 | if (!test_bit(MD_RECOVERY_SYNC, &conf->mddev->recovery)) | ||
1129 | md_error(r10_bio->mddev, | ||
1130 | conf->mirrors[d].rdev); | ||
1131 | } | ||
1128 | 1132 | ||
1129 | /* for reconstruct, we always reschedule after a read. | 1133 | /* for reconstruct, we always reschedule after a read. |
1130 | * for resync, only after all reads | 1134 | * for resync, only after all reads |
@@ -1430,6 +1434,7 @@ static void raid10d(mddev_t *mddev) | |||
1430 | sl--; | 1434 | sl--; |
1431 | d = r10_bio->devs[sl].devnum; | 1435 | d = r10_bio->devs[sl].devnum; |
1432 | rdev = conf->mirrors[d].rdev; | 1436 | rdev = conf->mirrors[d].rdev; |
1437 | atomic_add(s, &rdev->corrected_errors); | ||
1433 | if (rdev && | 1438 | if (rdev && |
1434 | test_bit(In_sync, &rdev->flags)) { | 1439 | test_bit(In_sync, &rdev->flags)) { |
1435 | if (sync_page_io(rdev->bdev, | 1440 | if (sync_page_io(rdev->bdev, |