Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit e528bed

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: stack max_user_sectors
The max_user_sectors is one of the three factors determining the actual max_sectors limit for READ/WRITE requests. Because of that it needs to be stacked at least for the device mapper multi-path case where requests are directly inserted on the lower device. For SCSI disks this is important because the sd driver actually sets it's own advisory limit that is lower than max_hw_sectors based on the block limits VPD page. While this is a bit odd an unusual, the same effect can happen if a user or udev script tweaks the value manually. Fixes: 4f563a6 ("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> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20240523182618.602003-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent bafea1c commit e528bed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

block/blk-settings.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,8 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
611611
unsigned int top, bottom, alignment, ret = 0;
612612

613613
t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
614+
t->max_user_sectors = min_not_zero(t->max_user_sectors,
615+
b->max_user_sectors);
614616
t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
615617
t->max_dev_sectors = min_not_zero(t->max_dev_sectors, b->max_dev_sectors);
616618
t->max_write_zeroes_sectors = min(t->max_write_zeroes_sectors,

0 commit comments

Comments
 (0)