Skip to content

Commit f063c54

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix missing io_queue_linked_timeout()
Whoever called io_prep_linked_timeout() should also do io_queue_linked_timeout(). __io_queue_sqe() doesn't follow that for the punting path leaving linked timeouts prepared but never queued. Fixes: 6df1db6 ("io_uring: fix mis-refcounting linked timeouts") Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent b65e0dd commit f063c54

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

fs/io_uring.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5987,20 +5987,20 @@ static void __io_queue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe,
59875987
* doesn't support non-blocking read/write attempts
59885988
*/
59895989
if (ret == -EAGAIN && !(req->flags & REQ_F_NOWAIT)) {
5990-
if (io_arm_poll_handler(req)) {
5991-
if (linked_timeout)
5992-
io_queue_linked_timeout(linked_timeout);
5993-
goto exit;
5994-
}
5990+
if (!io_arm_poll_handler(req)) {
59955991
punt:
5996-
ret = io_prep_work_files(req);
5997-
if (unlikely(ret))
5998-
goto err;
5999-
/*
6000-
* Queued up for async execution, worker will release
6001-
* submit reference when the iocb is actually submitted.
6002-
*/
6003-
io_queue_async_work(req);
5992+
ret = io_prep_work_files(req);
5993+
if (unlikely(ret))
5994+
goto err;
5995+
/*
5996+
* Queued up for async execution, worker will release
5997+
* submit reference when the iocb is actually submitted.
5998+
*/
5999+
io_queue_async_work(req);
6000+
}
6001+
6002+
if (linked_timeout)
6003+
io_queue_linked_timeout(linked_timeout);
60046004
goto exit;
60056005
}
60066006

0 commit comments

Comments
 (0)