Skip to content

Commit

Permalink
io_uring: pass correct parameters to io_req_set_res
Browse files Browse the repository at this point in the history
The two parameters of 'res' and 'cflags' are swapped, so fix it.
Without this fix, 'ublk del' hangs forever.

Cc: Pavel Begunkov <[email protected]>
Fixes: de23077 ("io_uring: set completion results upfront")
Signed-off-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Ming Lei authored and axboe committed Aug 3, 2022
1 parent e2b5421 commit ff2557b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion io_uring/uring_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, ssize_t res2)
if (ret < 0)
req_set_fail(req);

io_req_set_res(req, 0, ret);
io_req_set_res(req, ret, 0);
if (req->ctx->flags & IORING_SETUP_CQE32)
io_req_set_cqe32_extra(req, res2, 0);
__io_req_complete(req, 0);
Expand Down

0 comments on commit ff2557b

Please sign in to comment.