提交 cf7a4416 编写于 作者: N NeilBrown 提交者: Linus Torvalds

md: make sure read errors are auto-corrected during a 'check' resync in raid1

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: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d7f3d291
...@@ -1214,7 +1214,8 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) ...@@ -1214,7 +1214,8 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
j = 0; j = 0;
if (j >= 0) if (j >= 0)
mddev->resync_mismatches += r1_bio->sectors; 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; sbio->bi_end_io = NULL;
rdev_dec_pending(conf->mirrors[i].rdev, mddev); rdev_dec_pending(conf->mirrors[i].rdev, mddev);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册