Skip to content
Commit 258bea63 authored by Christoph Böhmwalder's avatar Christoph Böhmwalder Committed by Jens Axboe
Browse files

drbd: use blk_queue_max_discard_sectors helper



We currently only set q->limits.max_discard_sectors, but that is not
enough. Another field, max_hw_discard_sectors, was introduced in
commit 0034af03 ("block: make /sys/block/<dev>/queue/discard_max_bytes
writeable").

The difference is that max_discard_sectors can be changed from user
space via sysfs, while max_hw_discard_sectors is the "hardware" upper
limit.

So use this helper, which sets both.

This is also a fixup for commit 998e9cbc ("drbd: cleanup
decide_on_discard_support"): if discards are not supported, that does
not necessarily mean we also want to disable write_zeroes.

Fixes: 998e9cbc ("drbd: cleanup decide_on_discard_support")
Reviewed-by: default avatarJoel Colledge <joel.colledge@linbit.com>
Signed-off-by: default avatarChristoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20221109133453.51652-2-christoph.boehmwalder@linbit.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6d4338cb
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