diff options
author | Christoph Hellwig <hch@lst.de> | 2025-04-09 15:09:40 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-04-15 18:59:15 -0600 |
commit | f2fed441c69b9237760840a45a004730ff324faf (patch) | |
tree | 5afbfb8b3ebe7f720fcd6d5fdb6b5b2638bd8a9d /rust/helpers/helpers.c | |
parent | 0dba7a05b9e47d8b546399117b0ddf2426dc6042 (diff) | |
download | linux-f2fed441c69b9237760840a45a004730ff324faf.tar.gz linux-f2fed441c69b9237760840a45a004730ff324faf.tar.bz2 linux-f2fed441c69b9237760840a45a004730ff324faf.zip |
loop: stop using vfs_iter_{read,write} for buffered I/O
vfs_iter_{read,write} always perform direct I/O when the file has the
O_DIRECT flag set, which breaks disabling direct I/O using the
LOOP_SET_STATUS / LOOP_SET_STATUS64 ioctls.
This was recenly reported as a regression, but as far as I can tell
was only uncovered by better checking for block sizes and has been
around since the direct I/O support was added.
Fix this by using the existing aio code that calls the raw read/write
iter methods instead. Note that despite the comments there is no need
for block drivers to ever call flush_dcache_page themselves, and the
call is a left-over from prehistoric times.
Fixes: ab1cb278bc70 ("block: loop: introduce ioctl command of LOOP_SET_DIRECT_IO")
Reported-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20250409130940.3685677-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions