We now allow more fixed buffers to be registered, update tests from the previous UIO_MAXIOV limit to something that will definitely fail. Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- test/io_uring_register.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/io_uring_register.c b/test/io_uring_register.c index 7bcb036..1d0981b 100644 --- a/test/io_uring_register.c +++ b/test/io_uring_register.c @@ -280,12 +280,16 @@ int test_iovec_nr(int fd) { int i, ret, status = 0; - unsigned int nr = UIO_MAXIOV + 1; + unsigned int nr = 1000000; struct iovec *iovs; void *buf; + iovs = malloc(nr * sizeof(struct iovec)); + if (!iovs) { + fprintf(stdout, "can't allocate iovecs, skip\n"); + return 0; + } buf = t_malloc(pagesize); - iovs = t_malloc(nr * sizeof(struct iovec)); for (i = 0; i < nr; i++) { iovs[i].iov_base = buf; @@ -295,7 +299,7 @@ test_iovec_nr(int fd) status |= expect_fail(fd, IORING_REGISTER_BUFFERS, iovs, nr, EINVAL); /* reduce to UIO_MAXIOV */ - nr--; + nr = UIO_MAXIOV; printf("io_uring_register(%d, %u, %p, %u)\n", fd, IORING_REGISTER_BUFFERS, iovs, nr); ret = __sys_io_uring_register(fd, IORING_REGISTER_BUFFERS, iovs, nr); -- 2.31.1