File close fixes
authorJens Axboe <jens.axboe@oracle.com>
Wed, 10 Jun 2009 07:05:13 +0000 (09:05 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 10 Jun 2009 07:05:13 +0000 (09:05 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c
fio.c

index 17bdd26..a0a4b80 100644 (file)
@@ -710,8 +710,10 @@ void close_files(struct thread_data *td)
        struct fio_file *f;
        unsigned int i;
 
-       for_each_file(td, f, i)
-               td_io_close_file(td, f);
+       for_each_file(td, f, i) {
+               if (fio_file_open(f))
+                       td_io_close_file(td, f);
+       }
 }
 
 void close_and_free_files(struct thread_data *td)
diff --git a/fio.c b/fio.c
index 61aabb3..632b002 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1374,8 +1374,6 @@ static void run_threads(void)
                        for_each_file(td, f, i) {
                                if (fio_file_open(f))
                                        td_io_close_file(td, f);
-                               else
-                                       assert(f->fd == -1);
                        }
                }