Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283401
b: refs/heads/master
c: 307729c
h: refs/heads/master
i:
  283399: 509021b
v: v3
  • Loading branch information
NeilBrown committed Jan 10, 2012
1 parent f6ce82a commit bfeee2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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: f2a371c5e74dd5685ab47effa4ac7b23b1fdaae5
refs/heads/master: 307729c8bc5b5a41361af8af95906eee7552acb1
11 changes: 10 additions & 1 deletion trunk/drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,17 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
if (test_bit(WriteMostly, &rdev->flags)) {
/* Don't balance among write-mostly, just
* use the first as a last resort */
if (best_disk < 0)
if (best_disk < 0) {
if (is_badblock(rdev, this_sector, sectors,
&first_bad, &bad_sectors)) {
if (first_bad < this_sector)
/* Cannot use this */
continue;
best_good_sectors = first_bad - this_sector;
} else
best_good_sectors = sectors;
best_disk = disk;
}
continue;
}
/* This is a reasonable device to use. It might
Expand Down

0 comments on commit bfeee2b

Please sign in to comment.