summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-10-10 19:34:13 +0200
committerJens Axboe <axboe@kernel.dk>2020-10-10 20:49:25 +0200
commit692d836351ffa05016521a769543af51c9dc3e9e (patch)
tree54e09ce50f27dec2bf7f82115b58865c328f75b3 /fs
parentio_uring: clean leftovers after splitting issue (diff)
downloadlinux-692d836351ffa05016521a769543af51c9dc3e9e.tar.xz
linux-692d836351ffa05016521a769543af51c9dc3e9e.zip
io_uring: don't delay io_init_req() error check
Don't postpone io_init_req() error checks and do that right after calling it. There is no control-flow statements or dependencies with sqe/submitted accounting, so do those earlier, that makes the code flow a bit more natural. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 2e0105c373ae..22d1fb9cc80f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6466,12 +6466,11 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
submitted = -EAGAIN;
break;
}
-
- err = io_init_req(ctx, req, sqe, &state);
io_consume_sqe(ctx);
/* will complete beyond this point, count as submitted */
submitted++;
+ err = io_init_req(ctx, req, sqe, &state);
if (unlikely(err)) {
fail_req:
io_put_req(req);