]> www.infradead.org Git - users/hch/block.git/commit
io_uring: update kiocb->ki_pos at execution time
authorDylan Yudaken <dylany@fb.com>
Tue, 22 Feb 2022 10:55:02 +0000 (02:55 -0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 Feb 2022 23:47:33 +0000 (16:47 -0700)
commit7255f9920a7166a35769ffe899b3d39834f7b98d
tree116a0611d976af62c5e14d917b5c23a3b765d1ed
parent5de6d1e610ab04811dc0f2d68c42d75083e81cce
io_uring: update kiocb->ki_pos at execution time

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.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c