From 80e88a1d4a84cb243a84a950363c0bce8f73d300 Mon Sep 17 00:00:00 2001 From: Peter Oberparleiter Date: Fri, 28 Feb 2014 09:09:13 -0800 Subject: [PATCH] fio: fix last block never being touched by random offsets Fix the available range for random offsets which never touched the last block. Signed-off-by: Christian Ehrhardt Signed-off-by: Jens Axboe --- io_u.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_u.c b/io_u.c index 77557dfd..75b23eb4 100644 --- a/io_u.c +++ b/io_u.c @@ -104,7 +104,7 @@ static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f, dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r); - *b = (lastb - 1) * (r / ((uint64_t) rmax + 1.0)); + *b = lastb * (r / ((uint64_t) rmax + 1.0)); } else { uint64_t off = 0; -- 2.25.1