mmap engine: fix open-for-size check
[fio.git] / engines / mmap.c
index 95ad1d842250049162564a078864070cc28c8f2e..f3d55c167691616a9d6478dba51e51154475ff3f 100644 (file)
@@ -60,6 +60,12 @@ static int fio_mmapio_open(struct thread_data *td, struct fio_file *f)
        if (ret)
                return ret;
 
+       /*
+        * for size checkup, don't mmap anything.
+        */
+       if (!f->io_size)
+               return 0;
+
        if (td_rw(td))
                flags = PROT_READ | PROT_WRITE;
        else if (td_write(td)) {