]> err.no Git - linux-2.6/commitdiff
md: make sure read errors are auto-corrected during a 'check' resync in raid1
authorNeilBrown <neilb@suse.de>
Wed, 17 Oct 2007 06:30:55 +0000 (23:30 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:43:03 +0000 (08:43 -0700)
Whenever a read error is found, we should attempt to overwrite with correct
data to 'fix' it.

However when do a 'check' pass (which compares data blocks that are
successfully read, but doesn't normally overwrite) we don't do that.  We
should.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/md/raid1.c

index 0bcefad8241334bcd7a83358ccdd1901cca04254..16775a0df7f6dbedb1648fc45793521557be3b5b 100644 (file)
@@ -1214,7 +1214,8 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
                                        j = 0;
                                if (j >= 0)
                                        mddev->resync_mismatches += r1_bio->sectors;
-                               if (j < 0 || test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) {
+                               if (j < 0 || (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)
+                                             && test_bit(BIO_UPTODATE, &sbio->bi_flags))) {
                                        sbio->bi_end_io = NULL;
                                        rdev_dec_pending(conf->mirrors[i].rdev, mddev);
                                } else {