From: Jens Axboe Date: Mon, 21 May 2007 12:52:43 +0000 (+0200) Subject: mmap engine: fix open-for-size check X-Git-Tag: fio-1.16.2~8 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c97d8369f04e562383f50a77a2b0e2abb102df75;ds=sidebyside mmap engine: fix open-for-size check Don't call into mmap() yet, since we didn't setup ->io_size. Signed-off-by: Jens Axboe --- diff --git a/engines/mmap.c b/engines/mmap.c index 95ad1d84..f3d55c16 100644 --- a/engines/mmap.c +++ b/engines/mmap.c @@ -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)) {