From: Jens Axboe Date: Tue, 11 Aug 2020 02:52:09 +0000 (-0600) Subject: engines/io_uring: make sure state is updated for requeues X-Git-Tag: fio-3.22~14 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=832faaafd3de59ebdb31043c04316ddbf0b95ad9;p=fio.git 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 --- 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; } }