t/io_uring: fix passthrough fixed buffer support
authorJens Axboe <axboe@kernel.dk>
Thu, 13 Feb 2025 15:58:17 +0000 (08:58 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Feb 2025 15:58:17 +0000 (08:58 -0700)
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 <axboe@kernel.dk>
t/io_uring.c

index eea5fe0a9fdd184adf09078caabc4ccfb9f1d210..581cfe53d2c316253411d337821fbca5e656222c 100644 (file)
@@ -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;