Fix fill_device with read/randread

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/filesetup.c b/filesetup.c
index c902bdf..5792813 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -132,7 +132,7 @@
 			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 @@
 	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);