diff options
author | Christoph Hellwig <hch@lst.de> | 2024-03-26 07:07:45 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-03-26 11:28:52 -0600 |
commit | 038105a200689ae07eb9e804ca2295e628a45820 (patch) | |
tree | 912888c67f1479bef1971105342efbd431b051ae /block/blk-settings.c | |
parent | dc53d9eac1db76fd27b1fcee1f64c840cf82b468 (diff) |
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 <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20240326060745.2349154-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r-- | block/blk-settings.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c index 3c7d8d638ab5..cdbaef159c4b 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -146,8 +146,7 @@ static int blk_validate_limits(struct queue_limits *lim) max_hw_sectors = min_not_zero(lim->max_hw_sectors, lim->max_dev_sectors); if (lim->max_user_sectors) { - if (lim->max_user_sectors > max_hw_sectors || - lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE) + if (lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE) return -EINVAL; lim->max_sectors = min(max_hw_sectors, lim->max_user_sectors); } else { |