filesetup: ensure to setup random generator properly
authorJens Axboe <axboe@kernel.dk>
Sat, 7 Dec 2019 05:03:04 +0000 (22:03 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 7 Dec 2019 05:03:04 +0000 (22:03 -0700)
If we have ZONED or ZONED_ABS set, we need to go through the same
path as RANDOM. If not, we fail miserably later.

Fixes: https://github.com/axboe/fio/issues/873
Signed-off-by: Jens Axboe <axboe@kernel.dk>
filesetup.c

index 7fe2ebd42406e9d93cbee838c983f4fc3ab815d1..ed3646a4bbe75e598e556970084bcb328c30fa3e 100644 (file)
@@ -1287,7 +1287,9 @@ static bool init_rand_distribution(struct thread_data *td)
        unsigned int i;
        int state;
 
-       if (td->o.random_distribution == FIO_RAND_DIST_RANDOM)
+       if (td->o.random_distribution == FIO_RAND_DIST_RANDOM ||
+           td->o.random_distribution == FIO_RAND_DIST_ZONED ||
+           td->o.random_distribution == FIO_RAND_DIST_ZONED_ABS)
                return false;
 
        state = td_bump_runstate(td, TD_SETTING_UP);