io_uring: fix sequencing issues with linked timeouts
authorJens Axboe <axboe@kernel.dk>
Fri, 15 Nov 2019 02:39:52 +0000 (19:39 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 02:56:05 +0000 (19:56 -0700)
commit94ae5e77a9150a8c6c57432e2db290c6868ddfad
treea6c8d37cacfd6f2574413dee43ab0346883e4d31
parentad8a48acc23cb13cbf4332ebabb867b1baa81842
io_uring: fix sequencing issues with linked timeouts

We have an issue with timeout links that are deeper in the submit chain,
because we only handle it upfront, not from later submissions. Move the
prep + issue of the timeout link to the async work prep handler, and do
it normally for non-async queue. If we validate and prepare the timeout
links upfront when we first see them, there's nothing stopping us from
supporting any sort of nesting.

Fixes: 2665abfd757f ("io_uring: add support for linked SQE timeouts")
Reported-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c