aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c15
1 files changed, 9 insertions, 6 deletions
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",