diff mbox

nbd: set the max segments to USHRT_MAX

Message ID 1492717621-9042-1-git-send-email-jbacik@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Josef Bacik April 20, 2017, 7:47 p.m. UTC
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>
---
 drivers/block/nbd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jens Axboe April 21, 2017, 1:54 a.m. UTC | #1
On 04/20/2017 01:47 PM, Josef Bacik wrote:
> 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.

Applied for 4.12, thanks Josef.
diff mbox

Patch

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 6e592c2..76e5f8f 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -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;