From: Jens Axboe Date: Sat, 30 May 2015 01:40:21 +0000 (-0600) Subject: filesetup: print warning if chosen random generator can't cover range X-Git-Tag: fio-2.2.9~26 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=37fbd7e9dd4f041b858507b3db06753614083770 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 --- 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;