]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit - block/blk-settings.c
block: allow max_discard_segments to be stacked
authorMike Snitzer <snitzer@redhat.com>
Fri, 20 Jul 2018 18:57:38 +0000 (14:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:00 +0000 (08:38 +0200)
commit030f2ad6ce16f3c49e4d9c65a4cd36f477f8e7b9
tree6d5d5baa019e2b74b311d0de77d1866d35422f23
parent394df591433deffef83b794bf95bd7ab12d56497
block: allow max_discard_segments to be stacked

[ Upstream commit 42c9cdfe1e11e083dceb0f0c4977b758cf7403b9 ]

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: 1e739730c5b9e ("block: optionally merge discontiguous discard bios into a single request")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-settings.c