From: Jens Axboe Date: Thu, 8 Nov 2012 07:36:00 +0000 (+0100) Subject: Zipf theta must be different than 1.0 X-Git-Tag: fio-2.0.11~22 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=18ded917799ea71ff950360fab7eebebe3c2f406 Zipf theta must be different than 1.0 Signed-off-by: Jens Axboe --- diff --git a/options.c b/options.c index c240692f..ae859882 100644 --- a/options.c +++ b/options.c @@ -750,9 +750,13 @@ static int str_random_distribution_cb(void *data, const char *str) free(nr); - if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) + if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) { + if (val == 1.00) { + log_err("fio: zipf theta must different than 1.0\n"); + return 1; + } td->o.zipf_theta = val; - else { + } else { if (val <= 0.00 || val >= 1.00) { log_err("fio: pareto input out of range (0 < input < 1.0)\n"); return 1; diff --git a/t/genzipf.c b/t/genzipf.c index dfb89929..e625defc 100644 --- a/t/genzipf.c +++ b/t/genzipf.c @@ -141,6 +141,10 @@ int main(int argc, char *argv[]) printf("pareto input must be > 0.00 and < 1.00\n"); return 1; } + if (val == 1.0 && use_zipf) { + printf("zipf input must be different than 1.0\n"); + return 1; + } nranges = DEF_NR; output_nranges = DEF_NR_OUTPUT;