Skip to contentSkip to conversation

io_uring: pass correct parameters to io_req_set_res

PATCH Superseded Ming Lei 2 participants 3 messages Aug 3, 2022 io_uring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 io_uring: pass correct parameters to io_req_set_res

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 27a9d66fec77 ("io_uring: kill extra io_uring_types.h includes")
---
 io_uring/uring_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/uring_cmd.c +1 -1
index 0a421ed51e7e..849d9708d612 100644
@@ -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);
Signature · 1 line
2.31.1
#1 lore raw
Quoted 2 lines · Ming Lei

The two parameters of 'res' and 'cflags' are swapped, so fix it. Without this fix, 'ublk del' hangs forever.

Looks good, but the "Fixes" tag is not right

Fixes de23077eda61f ("io_uring: set completion results upfront")
Quoted 20 lines
Cc Pavel Begunkov <[email protected]>
Fixes 27a9d66fec77 ("io_uring: kill extra io_uring_types.h includes")
---
  io_uring/uring_cmd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/uring_cmd.c +1 -1
index 0a421ed51e7e..849d9708d612 100644
@@ -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);
Signature · 1 line
Pavel Begunkov
author
#2 lore raw
Quoted 7 lines · Pavel Begunkov
Quoted 2 lines · Ming Lei

The two parameters of 'res' and 'cflags' are swapped, so fix it. Without this fix, 'ublk del' hangs forever.

Looks good, but the "Fixes" tag is not right

Fixes de23077eda61f ("io_uring: set completion results upfront")

Indeed, the issue is firstly added in above commit.

Thanks,
Ming