From 0d1cd207e409a36313784cb9596990c819775f77 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 5 Jun 2009 22:11:52 +0200 Subject: [PATCH] Fix fill_device with read/randread Signed-off-by: Jens Axboe --- filesetup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/filesetup.c b/filesetup.c index c902bdf7..57928133 100644 --- a/filesetup.c +++ b/filesetup.c @@ -132,7 +132,7 @@ static int extend_file(struct thread_data *td, struct fio_file *f) goto err; } } - if (td->o.fill_device) { + if (td->o.fill_device && !td_write(td)) { fio_file_clear_size_known(f); if (td_io_get_file_size(td, f)) goto err; @@ -290,6 +290,9 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, if (off == -1ULL) off = f->file_offset; + if (len == -1ULL || off == -1ULL) + return 0; + dprint(FD_IO, "invalidate cache %s: %llu/%llu\n", f->file_name, off, len); -- 2.25.1