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/uring_cmd: fix buffer index retrieval

Add back buffer index retrieval for IORING_URING_CMD_FIXED.

Reported-by: Guangwu Zhang <guazhang@redhat.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Fixes: b54a14041ee6 ("io_uring/rsrc: add io_rsrc_node_lookup() helper")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Tested-by: Guangwu Zhang <guazhang@redhat.com>
Link: https://lore.kernel.org/r/20241111101318.1387557-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
a43e236f 039c878d

+2 -1
+2 -1
io_uring/uring_cmd.c
··· 210 210 if (ioucmd->flags & IORING_URING_CMD_FIXED) { 211 211 struct io_ring_ctx *ctx = req->ctx; 212 212 struct io_rsrc_node *node; 213 + u16 index = READ_ONCE(sqe->buf_index); 213 214 214 - node = io_rsrc_node_lookup(&ctx->buf_table, req->buf_index); 215 + node = io_rsrc_node_lookup(&ctx->buf_table, index); 215 216 if (unlikely(!node)) 216 217 return -EFAULT; 217 218 /*