Fix bug with time_based run
authorJens Axboe <jens.axboe@oracle.com>
Wed, 23 May 2007 07:34:42 +0000 (09:34 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 23 May 2007 07:34:42 +0000 (09:34 +0200)
We need to clear the FIO_FILE_DONE flag and the number of
files done, to avoid do_io() exiting quickly for a re-run.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index 6483e64..9e93159 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;