Commit 91fb90e9 authored by Dylan Yudaken's avatar Dylan Yudaken Committed by Greg Kroah-Hartman
Browse files

UPSTREAM: io_uring: update kiocb->ki_pos at execution time



commit d34e1e5b upstream.

Update kiocb->ki_pos at execution time rather than in io_prep_rw().
io_prep_rw() happens before the job is enqueued to a worker and so the
offset might be read multiple times before being executed once.

Ensures that the file position in a set of _linked_ SQEs will be only
obtained after earlier SQEs have completed, and so will include their
incremented file position.

Change-Id: I3a7cdb36d4cd8ca659ae5db146e55a3e614811d9
Signed-off-by: default avatarDylan Yudaken <dylany@fb.com>
Reviewed-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit ff8a0702)
Bug: 268174392
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 6c93223d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment