From 18ded917799ea71ff950360fab7eebebe3c2f406 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 8 Nov 2012 08:36:00 +0100 Subject: [PATCH] Zipf theta must be different than 1.0 Signed-off-by: Jens Axboe --- options.c | 8 ++++++-- t/genzipf.c | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) 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; -- 2.25.1