From d11a531f38b9b612dfb3bd09c89d011dc786f81d Mon Sep 17 00:00:00 2001 From: "ljzhang,Yaxin Hu,Jianchao Tang" Date: Fri, 27 Jul 2007 15:54:10 +0200 Subject: [PATCH] [PATCH] Fix file_size_high It is generating a size between [file_size_low, file_size_low+file_size_high] where it should be [file_size_low, file_size_high]. Signed-off-by: Jens Axboe --- filesetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesetup.c b/filesetup.c index b8b22b5a..58c5015c 100644 --- a/filesetup.c +++ b/filesetup.c @@ -104,7 +104,7 @@ static unsigned long long get_rand_file_size(struct thread_data *td) long r; r = os_random_long(&td->file_size_state); - ret = td->o.file_size_low + (unsigned long long) ((double) td->o.file_size_high * (r / (RAND_MAX + 1.0))); + ret = td->o.file_size_low + (unsigned long long) ((double) (td->o.file_size_high - td->o.file_size_low) * (r / (RAND_MAX + 1.0))); ret -= (ret % td->o.rw_min_bs); return ret; } -- 2.25.1