Skip to content
Commit 149fb01c authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Greg Kroah-Hartman
Browse files

sd: also set max_user_sectors when setting max_sectors

[ Upstream commit bafea1c5 ]

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: 4f563a64

 ("block: add a max_user_discard_sectors queue limit")
Reported-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarMike Snitzer <snitzer@kernel.org>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240523182618.602003-2-hch@lst.de
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 11173662
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