Commit e1263d46 authored by NeilBrown's avatar NeilBrown Committed by Ben Hutchings

md/raid0: apply base queue limits *before* disk_stack_limits

commit 66eefe5d upstream.

Calling e.g. blk_queue_max_hw_sectors() after calls to
disk_stack_limits() discards the settings determined by
disk_stack_limits().
So we need to make those calls first.

Fixes: 199dc6ed ("md/raid0: update queue parameter in a safer location.")
Reported-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
[bwh: Backported to 3.2: the code being moved looks a little different]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 1afa0468
...@@ -358,16 +358,17 @@ static int raid0_run(struct mddev *mddev) ...@@ -358,16 +358,17 @@ static int raid0_run(struct mddev *mddev)
} }
conf = mddev->private; conf = mddev->private;
list_for_each_entry(rdev, &mddev->disks, same_set) {
disk_stack_limits(mddev->gendisk, rdev->bdev,
rdev->data_offset << 9);
}
blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors); blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9); blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
blk_queue_io_opt(mddev->queue, blk_queue_io_opt(mddev->queue,
(mddev->chunk_sectors << 9) * mddev->raid_disks); (mddev->chunk_sectors << 9) * mddev->raid_disks);
list_for_each_entry(rdev, &mddev->disks, same_set) {
disk_stack_limits(mddev->gendisk, rdev->bdev,
rdev->data_offset << 9);
}
/* calculate array device size */ /* calculate array device size */
md_set_array_sectors(mddev, raid0_size(mddev, 0, 0)); md_set_array_sectors(mddev, raid0_size(mddev, 0, 0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment