Skip to content

Commit 038105a

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: don't reject too large max_user_sectors in blk_validate_limits
We already cap down the actual max_sectors to the max of the hardware and user limit, so don't reject the configuration. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent dc53d9e commit 038105a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

block/blk-settings.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ static int blk_validate_limits(struct queue_limits *lim)
146146
max_hw_sectors = min_not_zero(lim->max_hw_sectors,
147147
lim->max_dev_sectors);
148148
if (lim->max_user_sectors) {
149-
if (lim->max_user_sectors > max_hw_sectors ||
150-
lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
149+
if (lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
151150
return -EINVAL;
152151
lim->max_sectors = min(max_hw_sectors, lim->max_user_sectors);
153152
} else {

0 commit comments

Comments
 (0)