From: Jens Axboe Date: Thu, 23 Sep 2021 15:15:16 +0000 (-0600) Subject: t/io_uring: ensure batch counts are smaller or equal to depth X-Git-Tag: fio-3.29~96 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c53476111d5ede61d24b3fa181fa2d19d3a3e6bc;p=fio.git t/io_uring: ensure batch counts are smaller or equal to depth If you use a batch submit or complete count that's larger than the depth, then t/io_uring will stall. Make sure to sanitize the counts so that any batch values is always <= total depth. Signed-off-by: Jens Axboe --- diff --git a/t/io_uring.c b/t/io_uring.c index 1adb8789..af1b8fa8 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -617,6 +617,11 @@ int main(int argc, char *argv[]) } } + if (batch_complete > depth) + batch_complete = depth; + if (batch_submit > depth) + batch_submit = depth; + submitter = calloc(nthreads, sizeof(*submitter) + depth * sizeof(struct iovec)); for (j = 0; j < nthreads; j++) {