Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377041
b: refs/heads/master
c: 3056e3a
h: refs/heads/master
i:
  377039: 9f2bc60
v: v3
  • Loading branch information
Alex Lyakas authored and NeilBrown committed Jun 13, 2013
1 parent 25fd853 commit 7abb162
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 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: 6b6204ee92adb53bfd6a77cb5679282ec3820c4b
refs/heads/master: 3056e3aec8d8ba61a0710fb78b2d562600aa2ea7
12 changes: 11 additions & 1 deletion trunk/drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,17 @@ static void raid1_end_write_request(struct bio *bio, int error)

r1_bio->bios[mirror] = NULL;
to_put = bio;
set_bit(R1BIO_Uptodate, &r1_bio->state);
/*
* Do not set R1BIO_Uptodate if the current device is
* rebuilding or Faulty. This is because we cannot use
* such device for properly reading the data back (we could
* potentially use it, if the current write would have felt
* before rdev->recovery_offset, but for simplicity we don't
* check this here.
*/
if (test_bit(In_sync, &conf->mirrors[mirror].rdev->flags) &&
!test_bit(Faulty, &conf->mirrors[mirror].rdev->flags))
set_bit(R1BIO_Uptodate, &r1_bio->state);

/* Maybe we can clear some bad blocks. */
if (is_badblock(conf->mirrors[mirror].rdev,
Expand Down
12 changes: 11 additions & 1 deletion trunk/drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,17 @@ static void raid10_end_write_request(struct bio *bio, int error)
sector_t first_bad;
int bad_sectors;

set_bit(R10BIO_Uptodate, &r10_bio->state);
/*
* Do not set R10BIO_Uptodate if the current device is
* rebuilding or Faulty. This is because we cannot use
* such device for properly reading the data back (we could
* potentially use it, if the current write would have felt
* before rdev->recovery_offset, but for simplicity we don't
* check this here.
*/
if (test_bit(In_sync, &rdev->flags) &&
!test_bit(Faulty, &rdev->flags))
set_bit(R10BIO_Uptodate, &r10_bio->state);

/* Maybe we can clear some bad blocks. */
if (is_badblock(rdev,
Expand Down

0 comments on commit 7abb162

Please sign in to comment.