From: Jens Axboe Date: Tue, 13 Mar 2007 13:50:28 +0000 (+0100) Subject: Check for open files on io operations X-Git-Tag: fio-1.14~11 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=3d7b485f9478ed5d291ec58a16a40781ae3ab4ae;hp=ebb1415f729c123b8a13bcbd667bf4b4cc95b4d4 Check for open files on io operations Signed-off-by: Jens Axboe --- diff --git a/fio.c b/fio.c index 4d628b9f..85eb22be 100644 --- a/fio.c +++ b/fio.c @@ -263,6 +263,8 @@ static void do_verify(struct thread_data *td) * read from disk. */ for_each_file(td, f, i) { + if (!(f->flags & FIO_FILE_OPEN)) + continue; if (fio_io_sync(td, f)) break; if (file_invalidate_cache(td, f)) @@ -520,8 +522,12 @@ static void do_io(struct thread_data *td) if (should_fsync(td) && td->end_fsync) { td_set_runstate(td, TD_FSYNCING); - for_each_file(td, f, i) + + for_each_file(td, f, i) { + if (!(f->flags & FIO_FILE_OPEN)) + continue; fio_io_sync(td, f); + } } } else cleanup_pending_aio(td); diff --git a/ioengines.c b/ioengines.c index 185314f0..b18bc9a2 100644 --- a/ioengines.c +++ b/ioengines.c @@ -186,6 +186,8 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) assert((io_u->flags & IO_U_F_FLIGHT) == 0); io_u->flags |= IO_U_F_FLIGHT; + assert(io_u->file->flags & FIO_FILE_OPEN); + io_u->error = 0; io_u->resid = 0;