nbd: set the max segments to USHRT_MAX
authorJosef Bacik <josef@toxicpanda.com>
Thu, 20 Apr 2017 19:47:01 +0000 (15:47 -0400)
committerJens Axboe <axboe@fb.com>
Fri, 21 Apr 2017 01:53:24 +0000 (19:53 -0600)
I lack the basic understanding of what segments mean, so we were being
limited to 512kib requests even with higher max_sectors sizes set.
Setting the maximum number of segments to unlimited allows us to
actually have arbitrarily large IO's go through NBD.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nbd.c

index d387bef07fcce7bb529ff7d8e56ce7e3f62d7fcb..5583dc4ff9415a68f36e58066b26d3ca451a3265 100644 (file)
@@ -1470,6 +1470,7 @@ static int nbd_dev_add(int index)
        disk->queue->limits.discard_granularity = 512;
        blk_queue_max_discard_sectors(disk->queue, UINT_MAX);
        blk_queue_max_segment_size(disk->queue, UINT_MAX);
+       blk_queue_max_segments(disk->queue, USHRT_MAX);
        blk_queue_max_hw_sectors(disk->queue, 65536);
        disk->queue->limits.max_sectors = 256;