]> www.infradead.org Git - users/hch/block.git/commit
sd: also set max_user_sectors when setting max_sectors
authorChristoph Hellwig <hch@lst.de>
Thu, 23 May 2024 18:22:03 +0000 (20:22 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 27 May 2024 06:30:25 +0000 (08:30 +0200)
commit69fc3484880d03a540ef16f6206300fb4f74ab1a
tree7b29aabca0ba4d25421ddcce206393454b325f84
parent1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
sd: also set max_user_sectors when setting max_sectors

sd can set a max_sectors value that is lower than the max_hw_sectors
limit based on the block limits VPD page.   While this is rather unusual,
it used to work until the max_user_sectors field was split out to cleanly
deal with conflicting hardware and user limits when the hardware limit
changes.  Also set max_user_sectors to ensure the limit can properly be
stacked.

Fixes: 4f563a64732d ("block: add a max_user_discard_sectors queue limit")
Reported-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mike Snitzer <snitzer@kernel.org>
drivers/scsi/sd.c