From c89daa4a98e6f3749ffc75b727a77cc061a0a454 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 1 Nov 2017 14:51:03 -0600 Subject: [PATCH] io_u: reset file to initial offset Don't assume that initial offset is 0, we should use the set f->file_offset when resetting. Fixes: 17373ce2f38a ("io_u: wrap to beginning when end-of-file is reached for time_based") Signed-off-by: Jens Axboe --- io_u.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_u.c b/io_u.c index 5e4209d3..81ee724b 100644 --- a/io_u.c +++ b/io_u.c @@ -367,7 +367,7 @@ static int get_next_seq_offset(struct thread_data *td, struct fio_file *f, */ if (f->last_pos[ddir] >= f->io_size + get_start_offset(td, f) && o->time_based) { - f->last_pos[ddir] = 0; + f->last_pos[ddir] = f->file_offset; loop_cache_invalidate(td, f); } -- 2.25.1