Fix problem with fadvise() and fill_device option
[fio.git] / filesetup.c
index 9fd04daae2f6ca2b58a61e68b0d4f816801c61a7..1372177efc67a6499c4a3c48483ff6b92981d981 100644 (file)
@@ -154,7 +154,6 @@ static int pre_read_file(struct thread_data *td, struct fio_file *f)
                        left -= bs;
                        continue;
                } else {
-                       printf("r=%d\n", r);
                        td_verror(td, EIO, "pre_read");
                        break;
                }
@@ -256,8 +255,11 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
 {
        int ret = 0;
 
-       if (len == -1ULL)
+       if (len == -1ULL) {
                len = f->io_size;
+               if (len == -1ULL && td->o.fill_device)
+                       return 0;
+       }
        if (off == -1ULL)
                off = f->file_offset;