summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-08-10 20:52:09 -0600
committerJens Axboe <axboe@kernel.dk>2020-08-10 20:52:09 -0600
commit832faaafd3de59ebdb31043c04316ddbf0b95ad9 (patch)
tree4a7ee2c415b5823ddf7f3f6a1fa83cc430a643f8
parentf0ed01ed095cf1ca7c1945a5a0267e8f73b7b4a9 (diff)
downloadfio-832faaafd3de59ebdb31043c04316ddbf0b95ad9.tar.gz
fio-832faaafd3de59ebdb31043c04316ddbf0b95ad9.tar.bz2
engines/io_uring: make sure state is updated for requeues
Currently we always use the start of the buffer and buffer length, but this isn't valid for a requeue. Make sure we updated both based on the actual io_u. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--engines/io_uring.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/engines/io_uring.c b/engines/io_uring.c
index 0ccd2318..57925594 100644
--- a/engines/io_uring.c
+++ b/engines/io_uring.c
@@ -234,13 +234,21 @@ static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
sqe->len = io_u->xfer_buflen;
sqe->buf_index = io_u->index;
} else {
+ struct iovec *iov = &ld->iovecs[io_u->index];
+
+ /*
+ * Update based on actual io_u, requeue could have
+ * adjusted these
+ */
+ iov->iov_base = io_u->xfer_buf;
+ iov->iov_len = io_u->xfer_buflen;
+
sqe->opcode = ddir_to_op[io_u->ddir][!!o->nonvectored];
if (o->nonvectored) {
- sqe->addr = (unsigned long)
- ld->iovecs[io_u->index].iov_base;
- sqe->len = ld->iovecs[io_u->index].iov_len;
+ sqe->addr = (unsigned long) iov->iov_base;
+ sqe->len = iov->iov_len;
} else {
- sqe->addr = (unsigned long) &ld->iovecs[io_u->index];
+ sqe->addr = (unsigned long) iov;
sqe->len = 1;
}
}