From: Peter Oberparleiter Date: Fri, 28 Feb 2014 17:09:13 +0000 (-0800) Subject: fio: fix last block never being touched by random offsets X-Git-Tag: fio-2.1.6~6 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=80e88a1d4a84cb243a84a950363c0bce8f73d300 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 --- 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;