Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57843
b: refs/heads/master
c: ed45666
h: refs/heads/master
i:
  57841: f48c608
  57839: 58638fa
v: v3
  • Loading branch information
Mike Accetta authored and Linus Torvalds committed Jun 16, 2007
1 parent a5191a4 commit cc19f00
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af03b8e4e81c3789e597632268940edd11ffe870
refs/heads/master: ed45666271f4fafa95b9d8ad44050e9a9bd2376e
21 changes: 14 additions & 7 deletions trunk/drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,17 +1240,24 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
}
r1_bio->read_disk = primary;
for (i=0; i<mddev->raid_disks; i++)
if (r1_bio->bios[i]->bi_end_io == end_sync_read &&
test_bit(BIO_UPTODATE, &r1_bio->bios[i]->bi_flags)) {
if (r1_bio->bios[i]->bi_end_io == end_sync_read) {
int j;
int vcnt = r1_bio->sectors >> (PAGE_SHIFT- 9);
struct bio *pbio = r1_bio->bios[primary];
struct bio *sbio = r1_bio->bios[i];
for (j = vcnt; j-- ; )
if (memcmp(page_address(pbio->bi_io_vec[j].bv_page),
page_address(sbio->bi_io_vec[j].bv_page),
PAGE_SIZE))
break;

if (test_bit(BIO_UPTODATE, &sbio->bi_flags)) {
for (j = vcnt; j-- ; ) {
struct page *p, *s;
p = pbio->bi_io_vec[j].bv_page;
s = sbio->bi_io_vec[j].bv_page;
if (memcmp(page_address(p),
page_address(s),
PAGE_SIZE))
break;
}
} else
j = 0;
if (j >= 0)
mddev->resync_mismatches += r1_bio->sectors;
if (j < 0 || test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) {
Expand Down

0 comments on commit cc19f00

Please sign in to comment.