]> git.baikalelectronics.ru Git - kernel.git/commit
loop: change queue block size to match when using DIO
authorMartijn Coenen <maco@android.com>
Wed, 4 Sep 2019 19:49:01 +0000 (21:49 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Oct 2019 15:36:01 +0000 (09:36 -0600)
commitcd33c1cc09ad348d1a08e656ab29559caa503584
tree56f84ad04027cb70b6536118004d519688c89cc6
parentcc35ee88d2d2b34aef6eebe9b6c71f99b0c84daf
loop: change queue block size to match when using DIO

The loop driver assumes that if the passed in fd is opened with
O_DIRECT, the caller wants to use direct I/O on the loop device.
However, if the underlying block device has a different block size than
the loop block queue, direct I/O can't be enabled. Instead of requiring
userspace to manually change the blocksize and re-enable direct I/O,
just change the queue block sizes to match, as well as the io_min size.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martijn Coenen <maco@android.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c