]> git.baikalelectronics.ru Git - kernel.git/commit
block: use lcm_not_zero() when stacking chunk_sectors
authorMike Snitzer <snitzer@redhat.com>
Tue, 22 Sep 2020 02:32:48 +0000 (22:32 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 Sep 2020 16:38:12 +0000 (10:38 -0600)
commitb80f724abc1fee5bcd09de45fdc6047cf202d928
tree98b57efbcc32558e049ae856491e88b7ba17e4ac
parentb4e5b797572cc8d658c527fdf52251a8a026895e
block: use lcm_not_zero() when stacking chunk_sectors

Like 'io_opt', blk_stack_limits() should stack 'chunk_sectors' using
lcm_not_zero() rather than min_not_zero() -- otherwise the final
'chunk_sectors' could result in sub-optimal alignment of IO to
component devices in the IO stack.

Also, if 'chunk_sectors' isn't a multiple of 'physical_block_size'
then it is a bug in the driver and the device should be flagged as
'misaligned'.

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c