Fix bug with time_based run
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 6483e64c9462eeae4075fa6f449dae7970bb1eeb..9e93159f42c161160134e209a3a643e49dc3cd61 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -736,11 +736,14 @@ static int clear_io_state(struct thread_data *td)
 
        td->last_was_sync = 0;
 
+       td->nr_done_files = 0;
+
        for_each_file(td, f, i)
                td_io_close_file(td, f);
 
        ret = 0;
        for_each_file(td, f, i) {
+               f->flags &= ~FIO_FILE_DONE;
                ret = td_io_open_file(td, f);
                if (ret)
                        break;