From ec803e97e616d8a410d760368c478b683625842a Mon Sep 17 00:00:00 2001 From: Brian Fulton Date: Fri, 24 Oct 2014 14:47:34 -0600 Subject: [PATCH] Loop Iteration Offset Bug Reset file descriptor offset value to the initial value when file is closed and io state is cleared. This fixes the bug where previous offset values persist between loop iterations. Signed-off-by: Jens Axboe --- libfio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libfio.c b/libfio.c index 9ed802a9..b823bd47 100644 --- a/libfio.c +++ b/libfio.c @@ -108,8 +108,10 @@ void clear_io_state(struct thread_data *td) reset_io_counters(td); close_files(td); - for_each_file(td, f, i) + for_each_file(td, f, i) { fio_file_clear_done(f); + f->file_offset = get_start_offset(td, f); + } /* * Set the same seed to get repeatable runs -- 2.25.1