Skip to content

Commit 692d836

Browse files
isilenceaxboe
authored andcommitted
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>
1 parent 062d04d commit 692d836

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

fs/io_uring.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6466,12 +6466,11 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
64666466
submitted = -EAGAIN;
64676467
break;
64686468
}
6469-
6470-
err = io_init_req(ctx, req, sqe, &state);
64716469
io_consume_sqe(ctx);
64726470
/* will complete beyond this point, count as submitted */
64736471
submitted++;
64746472

6473+
err = io_init_req(ctx, req, sqe, &state);
64756474
if (unlikely(err)) {
64766475
fail_req:
64776476
io_put_req(req);

0 commit comments

Comments
 (0)