]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit29ecb2fdf0611907683efa155cf64b65421a5e1e
treefe6b0e574f15fd5d6fb27bf009e8bf0020e95023
parentb04153647a7987dde31fa6f83a7132a8aafb4f76
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