]> asedeno.scripts.mit.edu Git - linux.git/commit
io_uring: remove punt of short reads to async context
authorJens Axboe <axboe@kernel.dk>
Tue, 7 Jan 2020 20:08:56 +0000 (13:08 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 7 Jan 2020 20:08:56 +0000 (13:08 -0700)
commiteacc6dfaea963ef61540abb31ad7829be5eff284
tree89ad2c9fa1f520cbfcf2e10301f6d4e8812a210a
parentfd1c4bc6e9b34a5e4fe7a3130a49380ef9d7037c
io_uring: remove punt of short reads to async context

We currently punt any short read on a regular file to async context,
but this fails if the short read is due to running into EOF. This is
especially problematic since we only do the single prep for commands
now, as we don't reset kiocb->ki_pos. This can result in a 4k read on
a 1k file returning zero, as we detect the short read and then retry
from async context. At the time of retry, the position is now 1k, and
we end up reading nothing, and hence return 0.

Instead of trying to patch around the fact that short reads can be
legitimate and won't succeed in case of retry, remove the logic to punt
a short read to async context. Simply return it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c