From e2d375856c5a443b340b06a33fb40740dda7fee9 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 13 Feb 2025 08:58:17 -0700 Subject: [PATCH] t/io_uring: fix passthrough fixed buffer support A previous commit changed t/io_uring to register a single region for all of the registered buffers, and while it updated non-passthrough IO for that change, the passthrough path still sets a specific buffer index. This makes passthrough with fixed buffers fail for any buffer but the first one, as it's asking for a buffer that doesn't exist rather than index the first one. That causes -EFAULT completions. Ensure the buf_index is set to 0 for passthrough as well. Fixes: 21f461f8c2b9 ("t/io_uring: register single buffer for whole IO region") Signed-off-by: Jens Axboe --- t/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/io_uring.c b/t/io_uring.c index eea5fe0a..581cfe53 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -628,7 +628,7 @@ static void init_io_pt(struct submitter *s, unsigned index) cmd->data_len = bs; if (fixedbufs) { sqe->uring_cmd_flags = IORING_URING_CMD_FIXED; - sqe->buf_index = index; + sqe->buf_index = 0; } cmd->nsid = f->nsid; cmd->opcode = 2; -- 2.25.1