Skip to content

Commit a43e236

Browse files
Ming Leiaxboe
authored andcommitted
io_uring/uring_cmd: fix buffer index retrieval
Add back buffer index retrieval for IORING_URING_CMD_FIXED. Reported-by: Guangwu Zhang <[email protected]> Cc: Jeff Moyer <[email protected]> Fixes: b54a140 ("io_uring/rsrc: add io_rsrc_node_lookup() helper") Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Kanchan Joshi <[email protected]> Reviewed-by: Anuj Gupta <[email protected]> Tested-by: Guangwu Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 039c878 commit a43e236

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

io_uring/uring_cmd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
210210
if (ioucmd->flags & IORING_URING_CMD_FIXED) {
211211
struct io_ring_ctx *ctx = req->ctx;
212212
struct io_rsrc_node *node;
213+
u16 index = READ_ONCE(sqe->buf_index);
213214

214-
node = io_rsrc_node_lookup(&ctx->buf_table, req->buf_index);
215+
node = io_rsrc_node_lookup(&ctx->buf_table, index);
215216
if (unlikely(!node))
216217
return -EFAULT;
217218
/*

0 commit comments

Comments
 (0)