aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/raid1.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 4317f8de143a..ab8113cff7c9 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -277,7 +277,8 @@ static inline void update_head_pos(int disk, struct r1bio *r1_bio)
277static int find_bio_disk(struct r1bio *r1_bio, struct bio *bio) 277static int find_bio_disk(struct r1bio *r1_bio, struct bio *bio)
278{ 278{
279 int mirror; 279 int mirror;
280 int raid_disks = r1_bio->mddev->raid_disks; 280 struct r1conf *conf = r1_bio->mddev->private;
281 int raid_disks = conf->raid_disks;
281 282
282 for (mirror = 0; mirror < raid_disks; mirror++) 283 for (mirror = 0; mirror < raid_disks; mirror++)
283 if (r1_bio->bios[mirror] == bio) 284 if (r1_bio->bios[mirror] == bio)
@@ -609,7 +610,7 @@ int md_raid1_congested(struct mddev *mddev, int bits)
609 return 1; 610 return 1;
610 611
611 rcu_read_lock(); 612 rcu_read_lock();
612 for (i = 0; i < mddev->raid_disks; i++) { 613 for (i = 0; i < conf->raid_disks; i++) {
613 struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev); 614 struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
614 if (rdev && !test_bit(Faulty, &rdev->flags)) { 615 if (rdev && !test_bit(Faulty, &rdev->flags)) {
615 struct request_queue *q = bdev_get_queue(rdev->bdev); 616 struct request_queue *q = bdev_get_queue(rdev->bdev);
@@ -1286,7 +1287,7 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1286 int mirror = 0; 1287 int mirror = 0;
1287 struct mirror_info *p; 1288 struct mirror_info *p;
1288 int first = 0; 1289 int first = 0;
1289 int last = mddev->raid_disks - 1; 1290 int last = conf->raid_disks - 1;
1290 1291
1291 if (mddev->recovery_disabled == conf->recovery_disabled) 1292 if (mddev->recovery_disabled == conf->recovery_disabled)
1292 return -EBUSY; 1293 return -EBUSY;