summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-01-06 00:20:52 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:34:09 -0800
commit4dbcdc751cb25ffca3a8374cbc5ab6de961cc545 (patch)
tree61d1eb6e35c0eec66e5a8610c1f57b1e6eec135c /drivers/md/raid1.c
parentd9d166c2a9d5d01af34396793950aa695883eed4 (diff)
downloadlinux-4dbcdc751cb25ffca3a8374cbc5ab6de961cc545.tar.gz
linux-4dbcdc751cb25ffca3a8374cbc5ab6de961cc545.tar.bz2
linux-4dbcdc751cb25ffca3a8374cbc5ab6de961cc545.zip
[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/raid1.c')
-rw-r--r--drivers/md/raid1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 181c9616d5f1..a06ff91f27e2 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1265,6 +1265,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
if (r1_bio->bios[d]->bi_end_io != end_sync_read)
continue;
rdev = conf->mirrors[d].rdev;
+ atomic_add(s, &rdev->corrected_errors);
if (sync_page_io(rdev->bdev,
sect + rdev->data_offset,
s<<9,
@@ -1463,6 +1464,7 @@ static void raid1d(mddev_t *mddev)
d = conf->raid_disks;
d--;
rdev = conf->mirrors[d].rdev;
+ atomic_add(s, &rdev->corrected_errors);
if (rdev &&
test_bit(In_sync, &rdev->flags)) {
if (sync_page_io(rdev->bdev,