Skip to content

Commit

Permalink
block: allow max_discard_segments to be stacked
Browse files Browse the repository at this point in the history
Set max_discard_segments to USHRT_MAX in blk_set_stacking_limits() so
that blk_stack_limits() can stack up this limit for stacked devices.

before:

$ cat /sys/block/nvme0n1/queue/max_discard_segments
256
$ cat /sys/block/dm-0/queue/max_discard_segments
1

after:

$ cat /sys/block/nvme0n1/queue/max_discard_segments
256
$ cat /sys/block/dm-0/queue/max_discard_segments
256

Fixes: 1e73973 ("block: optionally merge discontiguous discard bios into a single request")
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
snitm authored and axboe committed Jul 24, 2018
1 parent c55183c commit 42c9cdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void blk_set_stacking_limits(struct queue_limits *lim)

/* Inherit limits from component devices */
lim->max_segments = USHRT_MAX;
lim->max_discard_segments = 1;
lim->max_discard_segments = USHRT_MAX;
lim->max_hw_sectors = UINT_MAX;
lim->max_segment_size = UINT_MAX;
lim->max_sectors = UINT_MAX;
Expand Down

0 comments on commit 42c9cdf

Please sign in to comment.