Skip to content

Commit 6bb3085

Browse files
Dylan Yudakenaxboe
authored andcommitted
io_uring: if a linked request has REQ_F_FORCE_ASYNC then run it async
REQ_F_FORCE_ASYNC was being ignored for re-queueing linked requests. Instead obey that flag. Signed-off-by: Dylan Yudaken <dylany@meta.com> Link: https://lore.kernel.org/r/20230127135227.3646353-2-dylany@meta.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent f586800 commit 6bb3085

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

io_uring/io_uring.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,10 +1417,12 @@ void io_req_task_submit(struct io_kiocb *req, bool *locked)
14171417
{
14181418
io_tw_lock(req->ctx, locked);
14191419
/* req->task == current here, checking PF_EXITING is safe */
1420-
if (likely(!(req->task->flags & PF_EXITING)))
1421-
io_queue_sqe(req);
1422-
else
1420+
if (unlikely(req->task->flags & PF_EXITING))
14231421
io_req_defer_failed(req, -EFAULT);
1422+
else if (req->flags & REQ_F_FORCE_ASYNC)
1423+
io_queue_iowq(req, locked);
1424+
else
1425+
io_queue_sqe(req);
14241426
}
14251427

14261428
void io_req_task_queue_fail(struct io_kiocb *req, int ret)

0 commit comments

Comments
 (0)