From: Brian Fulton Date: Fri, 24 Oct 2014 20:47:34 +0000 (-0600) Subject: Loop Iteration Offset Bug X-Git-Tag: fio-2.1.14~33 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=ec803e97e616d8a410d760368c478b683625842a;ds=sidebyside 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 --- 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