On Wed, Nov 11, 2020 at 10:00:43PM +0900, Damien Le Moal wrote: > Block device drivers do not have to call blk_queue_max_hw_sectors() to > set a limit on request size if the default limit BLK_SAFE_MAX_SECTORS > is acceptable. However, this limit (255 sectors) may not be aligned > to the device logical block size which cannot be used as is for a > request maximum size. This is the case for the null_blk device driver. > > Modify blk_queue_max_hw_sectors() to make sure that the request size > limits specified by the max_hw_sectors and max_sectors queue limits > are always aligned to the device logical block size. Additionally, to > avoid introducing a dependence on the execution order of this function > with blk_queue_logical_block_size(), also modify > blk_queue_logical_block_size() to perform the same alignment when the > logical block size is set after max_hw_sectors. > > Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxx> Looks good, Reviewed-by: Christoph Hellwig <hch@xxxxxx>