Skip to content

Commit 3710561

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: don't reduce max_sectors based on io_opt
Don't reduce the max_sectors value below the normal cap when the driver advertsizes a very low io_opt. This restores the behavior we had before the recent changes to the max_sectors calculation. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Nitesh Shetty <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent f62e8ed commit 3710561

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/blk-settings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int blk_validate_limits(struct queue_limits *lim)
276276
if (lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
277277
return -EINVAL;
278278
lim->max_sectors = min(max_hw_sectors, lim->max_user_sectors);
279-
} else if (lim->io_opt) {
279+
} else if (lim->io_opt > (BLK_DEF_MAX_SECTORS_CAP << SECTOR_SHIFT)) {
280280
lim->max_sectors =
281281
min(max_hw_sectors, lim->io_opt >> SECTOR_SHIFT);
282282
} else if (lim->io_min > (BLK_DEF_MAX_SECTORS_CAP << SECTOR_SHIFT)) {

0 commit comments

Comments
 (0)