Zipf theta must be different than 1.0
authorJens Axboe <axboe@kernel.dk>
Thu, 8 Nov 2012 07:36:00 +0000 (08:36 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Nov 2012 07:36:00 +0000 (08:36 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
options.c
t/genzipf.c

index c240692f6ccc26d3f415f6bbe3a6640ff32348f2..ae8598825e048a783da985bf9c6d89b8fb2530a2 100644 (file)
--- 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;
index dfb89929eb00e2e24e2775878903e8eecc670372..e625defc60cecd2c0f82c481175b7ebe1b6bda6b 100644 (file)
@@ -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;