From 09ad10d26facf5ca026589996ba2719b640df35a Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 10 Jul 2018 15:10:17 -0600 Subject: [PATCH] io_u: ensure we generate the full length of block sizes Since we round down, we can miss the last entry. This ensures that if we do: bsrange=4k-16k we actually get an even split of 4,8,12,16k ios. Signed-off-by: Jens Axboe --- io_u.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/io_u.c b/io_u.c index 9e9dad5a..5221a78c 100644 --- a/io_u.c +++ b/io_u.c @@ -541,10 +541,8 @@ static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u, r = __rand(&td->bsrange_state[ddir]); if (!td->o.bssplit_nr[ddir]) { - buflen = 1 + (unsigned int) ((double) maxbs * + buflen = minbs + (unsigned int) ((double) maxbs * (r / (frand_max + 1.0))); - if (buflen < minbs) - buflen = minbs; } else { long long perc = 0; unsigned int i; -- 2.25.1