diff mbox series

[liburing] example/io_uring-test.c: Fix iovecs increment

Message ID 5C501554-CE72-443C-88B1-FED5AC810554@raithlin.com (mailing list archive)
State New, archived
Headers show
Series [liburing] example/io_uring-test.c: Fix iovecs increment | expand

Commit Message

Stephen Bates June 11, 2019, 1:37 p.m. UTC
This example misses an increment though the iovecs array. This causes
the same buffer to be filled from the block device every time. It would 
be good to fix this since it is one of the first examples a new-comer to
io_uring is exposed too.

Signed-off-by: Stephen Bates <sbates@raithlin.com>
---
 examples/io_uring-test.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jens Axboe June 13, 2019, 9:05 a.m. UTC | #1
On 6/11/19 7:37 AM, Stephen  Bates wrote:
> This example misses an increment though the iovecs array. This causes
> the same buffer to be filled from the block device every time. It would
> be good to fix this since it is one of the first examples a new-comer to
> io_uring is exposed too.

I hand applied this patch, it's coming through as encoded. But fix looks
good, thanks.
diff mbox series

Patch

diff --git a/examples/io_uring-test.c b/examples/io_uring-test.c
index bbac3a7..0b975ad 100644
--- a/examples/io_uring-test.c
+++ b/examples/io_uring-test.c
@@ -56,6 +56,7 @@  int main(int argc, char *argv[])
 			break;
 		io_uring_prep_readv(sqe, fd, &iovecs[i], 1, offset);
 		offset += iovecs[i].iov_len;
+		i++;
 	} while (1);
 
 	ret = io_uring_submit(&ring);