OSDN Git Service

io_uring: fix cached_sq_head in io_timeout()
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 14 Apr 2020 21:39:48 +0000 (00:39 +0300)
committerJens Axboe <axboe@kernel.dk>
Wed, 15 Apr 2020 01:16:55 +0000 (19:16 -0600)
commit22cad1585c6bc6caf2688701004cf2af6865cbe0
treefe6b0e574f15fd5d6fb27bf009e8bf0020e95023
parent8e2e1faf28b3e66430f55f0b0ee83370ecc150af
io_uring: fix cached_sq_head in io_timeout()

io_timeout() can be executed asynchronously by a worker and without
holding ctx->uring_lock

1. using ctx->cached_sq_head there is racy there
2. it should count events from a moment of timeout's submission, but
not execution

Use req->sequence.

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