diff --git a/[refs] b/[refs] index 7acd99c2d2f8..67cc8915e989 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f2a371c5e74dd5685ab47effa4ac7b23b1fdaae5 +refs/heads/master: 307729c8bc5b5a41361af8af95906eee7552acb1 diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index cc24f0cb7ee3..a368db2431a5 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -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