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 17bdd2639f6ce3cc75e192063c1c5276ba6076e0..a0a4b80d33483d70c00db8fe56882ce073136286 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 61aabb301d35e4abacbd070f9b528122d8fd3de8..632b0025a4e5a8476f1694c91562a57b6cc56580 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);
                        }
                }