diff --git a/fs/io_uring.c b/fs/io_uring.c index e4c919112ce8c99eb98c73aba7cdd8dcfebba46c..f0f214d69fd8db4f5f84a4be205aab1e3c6d2460 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4509,6 +4509,7 @@ static void __io_queue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe) */ if (ret == -EAGAIN && (!(req->flags & REQ_F_NOWAIT) || (req->flags & REQ_F_MUST_PUNT))) { +punt: if (req->work.flags & IO_WQ_WORK_NEEDS_FILES) { ret = io_grab_files(req); if (ret) @@ -4544,6 +4545,9 @@ static void __io_queue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe) if (nxt) { req = nxt; nxt = NULL; + + if (req->flags & REQ_F_FORCE_ASYNC) + goto punt; goto again; } }