]> git.baikalelectronics.ru Git - kernel.git/commitdiff
io_uring: pass correct parameters to io_req_set_res
authorMing Lei <ming.lei@redhat.com>
Wed, 3 Aug 2022 12:07:57 +0000 (20:07 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 3 Aug 2022 14:45:25 +0000 (08:45 -0600)
The two parameters of 'res' and 'cflags' are swapped, so fix it.
Without this fix, 'ublk del' hangs forever.

Cc: Pavel Begunkov <asml.silence@gmail.com>
Fixes: 603a3eb24227f ("io_uring: set completion results upfront")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220803120757.1668278-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/uring_cmd.c

index 0a421ed51e7e168c1258efe3de46a4b084fa2b2f..849d9708d612f33ae2941ddee515612a1e9afa5b 100644 (file)
@@ -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);