summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorDylan Yudaken <dylany@meta.com>2023-01-27 05:52:24 -0800
committerJens Axboe <axboe@kernel.dk>2023-01-29 15:18:26 -0700
commit6bb30855560e6343e7b88595d7c3159d0f848a04 (patch)
treec2c71eb8be41799be15384d26a8172ac527b3279 /io_uring
parentf58680085478dd292435727210122960d38e8014 (diff)
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>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index acf6d9680d76..0e42160a3051 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1417,10 +1417,12 @@ void io_req_task_submit(struct io_kiocb *req, bool *locked)
{
io_tw_lock(req->ctx, locked);
/* req->task == current here, checking PF_EXITING is safe */
- if (likely(!(req->task->flags & PF_EXITING)))
- io_queue_sqe(req);
- else
+ if (unlikely(req->task->flags & PF_EXITING))
io_req_defer_failed(req, -EFAULT);
+ else if (req->flags & REQ_F_FORCE_ASYNC)
+ io_queue_iowq(req, locked);
+ else
+ io_queue_sqe(req);
}
void io_req_task_queue_fail(struct io_kiocb *req, int ret)