diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/faulty.c | 5 | ||||
-rw-r--r-- | drivers/md/raid1.c | 2 | ||||
-rw-r--r-- | drivers/md/raid10.c | 15 |
3 files changed, 14 insertions, 8 deletions
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c index 45135f69509c..5e7dc772f5de 100644 --- a/drivers/md/faulty.c +++ b/drivers/md/faulty.c | |||
@@ -315,8 +315,11 @@ static int run(struct mddev *mddev) | |||
315 | } | 315 | } |
316 | conf->nfaults = 0; | 316 | conf->nfaults = 0; |
317 | 317 | ||
318 | rdev_for_each(rdev, mddev) | 318 | rdev_for_each(rdev, mddev) { |
319 | conf->rdev = rdev; | 319 | conf->rdev = rdev; |
320 | disk_stack_limits(mddev->gendisk, rdev->bdev, | ||
321 | rdev->data_offset << 9); | ||
322 | } | ||
320 | 323 | ||
321 | md_set_array_sectors(mddev, faulty_size(mddev, 0, 0)); | 324 | md_set_array_sectors(mddev, faulty_size(mddev, 0, 0)); |
322 | mddev->private = conf; | 325 | mddev->private = conf; |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 8034fbd6190c..636bae0405e8 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -2710,7 +2710,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) | |||
2710 | || disk_idx < 0) | 2710 | || disk_idx < 0) |
2711 | continue; | 2711 | continue; |
2712 | if (test_bit(Replacement, &rdev->flags)) | 2712 | if (test_bit(Replacement, &rdev->flags)) |
2713 | disk = conf->mirrors + conf->raid_disks + disk_idx; | 2713 | disk = conf->mirrors + mddev->raid_disks + disk_idx; |
2714 | else | 2714 | else |
2715 | disk = conf->mirrors + disk_idx; | 2715 | disk = conf->mirrors + disk_idx; |
2716 | 2716 | ||
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 906ccbd0f7dc..d1295aff4173 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1783,7 +1783,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev) | |||
1783 | clear_bit(Unmerged, &rdev->flags); | 1783 | clear_bit(Unmerged, &rdev->flags); |
1784 | } | 1784 | } |
1785 | md_integrity_add_rdev(rdev, mddev); | 1785 | md_integrity_add_rdev(rdev, mddev); |
1786 | if (blk_queue_discard(bdev_get_queue(rdev->bdev))) | 1786 | if (mddev->queue && blk_queue_discard(bdev_get_queue(rdev->bdev))) |
1787 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); | 1787 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); |
1788 | 1788 | ||
1789 | print_conf(conf); | 1789 | print_conf(conf); |
@@ -3613,11 +3613,14 @@ static int run(struct mddev *mddev) | |||
3613 | discard_supported = true; | 3613 | discard_supported = true; |
3614 | } | 3614 | } |
3615 | 3615 | ||
3616 | if (discard_supported) | 3616 | if (mddev->queue) { |
3617 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); | 3617 | if (discard_supported) |
3618 | else | 3618 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, |
3619 | queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue); | 3619 | mddev->queue); |
3620 | 3620 | else | |
3621 | queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, | ||
3622 | mddev->queue); | ||
3623 | } | ||
3621 | /* need to check that every block has at least one working mirror */ | 3624 | /* need to check that every block has at least one working mirror */ |
3622 | if (!enough(conf, -1)) { | 3625 | if (!enough(conf, -1)) { |
3623 | printk(KERN_ERR "md/raid10:%s: not enough operational mirrors.\n", | 3626 | printk(KERN_ERR "md/raid10:%s: not enough operational mirrors.\n", |