io_u: produce bad offsets for some time_based jobs
authorVincent Fu <vincent.fu@samsung.com>
Wed, 23 Mar 2022 22:22:37 +0000 (18:22 -0400)
committerVincent Fu <vincent.fu@samsung.com>
Wed, 23 Mar 2022 22:22:37 +0000 (18:22 -0400)
Allow get_next_seq_offset to produce bad offsets for time_based jobs
when fio is accessing more than one file. Otherwise fio will not skip to
the next file once the current one is done.

Fixes: https://github.com/axboe/fio/issues/1372

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
io_u.c

diff --git a/io_u.c b/io_u.c
index 806ceb77761f549a0fc82e5da557b8c83d43ecaa..50197a4bfa70c83f99981c0f7719172a9243d178 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -355,7 +355,7 @@ static int get_next_seq_offset(struct thread_data *td, struct fio_file *f,
         * and invalidate the cache, if we need to.
         */
        if (f->last_pos[ddir] >= f->io_size + get_start_offset(td, f) &&
-           o->time_based) {
+           o->time_based && o->nr_files == 1) {
                f->last_pos[ddir] = f->file_offset;
                loop_cache_invalidate(td, f);
        }