From: Jens Axboe Date: Wed, 1 Nov 2017 20:51:03 +0000 (-0600) Subject: io_u: reset file to initial offset X-Git-Tag: fio-3.2~14 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c89daa4a98e6f3749ffc75b727a77cc061a0a454 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 --- 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); }