Skip to content

Commit

Permalink
md/raid1: fix buglet in md_raid1_contested.
Browse files Browse the repository at this point in the history
Since we added 'replacement' capability, RAID1 can have twice
as many devices as ->raid_disks indicates.
So md_raid1_congested needs to check that many possible devices,
not just ->raid_disks many.

Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
NeilBrown committed Feb 13, 2012
1 parent db91ff5 commit f53e29f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ int md_raid1_congested(struct mddev *mddev, int bits)
return 1;

rcu_read_lock();
for (i = 0; i < conf->raid_disks; i++) {
for (i = 0; i < conf->raid_disks * 2; i++) {
struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
if (rdev && !test_bit(Faulty, &rdev->flags)) {
struct request_queue *q = bdev_get_queue(rdev->bdev);
Expand Down

0 comments on commit f53e29f

Please sign in to comment.