diff options
author | Dylan Yudaken <dylany@meta.com> | 2023-01-27 14:52:25 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-01-29 23:18:26 +0100 |
commit | aebb224fd4fc7352cd839ad90414c548387142fd (patch) | |
tree | 8f209de8d9e8eec51774f27764dd5229d0a2d463 /io_uring/statx.c | |
parent | io_uring: if a linked request has REQ_F_FORCE_ASYNC then run it async (diff) | |
download | linux-aebb224fd4fc7352cd839ad90414c548387142fd.tar.xz linux-aebb224fd4fc7352cd839ad90414c548387142fd.zip |
io_uring: for requests that require async, force it
Some requests require being run async as they do not support
non-blocking. Instead of trying to issue these requests, getting -EAGAIN
and then queueing them for async issue, rather just force async upfront.
Add WARN_ON_ONCE to make sure surprising code paths do not come up,
however in those cases the bug would end up being a blocking
io_uring_enter(2) which should not be critical.
Signed-off-by: Dylan Yudaken <dylany@meta.com>
Link: https://lore.kernel.org/r/20230127135227.3646353-3-dylany@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/statx.c')
-rw-r--r-- | io_uring/statx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/statx.c b/io_uring/statx.c index d8fc933d3f59..abb874209caa 100644 --- a/io_uring/statx.c +++ b/io_uring/statx.c @@ -48,6 +48,7 @@ int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) } req->flags |= REQ_F_NEED_CLEANUP; + req->flags |= REQ_F_FORCE_ASYNC; return 0; } @@ -56,8 +57,7 @@ int io_statx(struct io_kiocb *req, unsigned int issue_flags) struct io_statx *sx = io_kiocb_to_cmd(req, struct io_statx); int ret; - if (issue_flags & IO_URING_F_NONBLOCK) - return -EAGAIN; + WARN_ON_ONCE(issue_flags & IO_URING_F_NONBLOCK); ret = do_statx(sx->dfd, sx->filename, sx->flags, sx->mask, sx->buffer); io_req_set_res(req, ret, 0); |