|
@@ -560,7 +560,7 @@ 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_dist_disk < 0) {
|
|
|
if (is_badblock(rdev, this_sector, sectors,
|
|
|
&first_bad, &bad_sectors)) {
|
|
|
if (first_bad < this_sector)
|
|
@@ -569,7 +569,8 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
|
|
|
best_good_sectors = first_bad - this_sector;
|
|
|
} else
|
|
|
best_good_sectors = sectors;
|
|
|
- best_disk = disk;
|
|
|
+ best_dist_disk = disk;
|
|
|
+ best_pending_disk = disk;
|
|
|
}
|
|
|
continue;
|
|
|
}
|