From 37fbd7e9dd4f041b858507b3db06753614083770 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 29 May 2015 19:40:21 -0600 Subject: [PATCH] filesetup: print warning if chosen random generator can't cover range If the file or device is huge, we could have an issue with the default 32-bit random offset generator in that it wont cover the entire device. If fio detects this and the random generator wasn't explicitly set, then log an error and exit. Signed-off-by: Jens Axboe --- filesetup.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/filesetup.c b/filesetup.c index f4324e23..51efdf76 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1067,6 +1067,16 @@ int init_random_map(struct thread_data *td) blocks = fsize / (unsigned long long) td->o.rw_min_bs; + if (blocks > FRAND32_MAX && + td->o.random_generator == FIO_RAND_GEN_TAUSWORTHE && + !fio_option_is_set(&td->o, random_generator)) { + log_err("fio: file %s exceeds 32-bit tausworthe " + "random generator. Use lfsr or " + "tausworthe64.\n", f->file_name); + td_verror(td, EINVAL, "init file random"); + return 1; + } + if (td->o.random_generator == FIO_RAND_GEN_LFSR) { unsigned long seed; -- 2.25.1