Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: add IORING_OP_URING_CMD128 to opcode checks

io_should_commit(), io_uring_classic_poll(), and io_do_iopoll() compare
struct io_kiocb's opcode against IORING_OP_URING_CMD to implement
special treatment for uring_cmds. The recently added opcode
IORING_OP_URING_CMD128 is meant to be equivalent to IORING_OP_URING_CMD,
so treat it the same way in these functions.

Fixes: 1cba30bf9fdd ("io_uring: add support for IORING_SETUP_SQE_MIXED")
Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Caleb Sander Mateos and committed by
Jens Axboe
42a6bd57 003049b1

+9 -3
+6
io_uring/io_uring.h
··· 530 530 return false; 531 531 } 532 532 533 + static inline bool io_is_uring_cmd(const struct io_kiocb *req) 534 + { 535 + return req->opcode == IORING_OP_URING_CMD || 536 + req->opcode == IORING_OP_URING_CMD128; 537 + } 538 + 533 539 static inline ktime_t io_get_time(struct io_ring_ctx *ctx) 534 540 { 535 541 if (ctx->clockid == CLOCK_MONOTONIC)
+1 -1
io_uring/kbuf.c
··· 171 171 return true; 172 172 173 173 /* uring_cmd commits kbuf upfront, no need to auto-commit */ 174 - if (!io_file_can_poll(req) && req->opcode != IORING_OP_URING_CMD) 174 + if (!io_file_can_poll(req) && !io_is_uring_cmd(req)) 175 175 return true; 176 176 return false; 177 177 }
+2 -2
io_uring/rw.c
··· 1254 1254 { 1255 1255 struct file *file = req->file; 1256 1256 1257 - if (req->opcode == IORING_OP_URING_CMD) { 1257 + if (io_is_uring_cmd(req)) { 1258 1258 struct io_uring_cmd *ioucmd; 1259 1259 1260 1260 ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd); ··· 1380 1380 wq_list_add_tail(&req->comp_list, &ctx->submit_state.compl_reqs); 1381 1381 nr_events++; 1382 1382 req->cqe.flags = io_put_kbuf(req, req->cqe.res, NULL); 1383 - if (req->opcode != IORING_OP_URING_CMD) 1383 + if (!io_is_uring_cmd(req)) 1384 1384 io_req_rw_cleanup(req, 0); 1385 1385 } 1386 1386 if (nr_events)