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 <axboe@kernel.dk>
*/
if (f->last_pos[ddir] >= f->io_size + get_start_offset(td, f) &&
o->time_based) {
*/
if (f->last_pos[ddir] >= f->io_size + get_start_offset(td, f) &&
o->time_based) {
+ f->last_pos[ddir] = f->file_offset;
loop_cache_invalidate(td, f);
}
loop_cache_invalidate(td, f);
}