From c97d8369f04e562383f50a77a2b0e2abb102df75 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 21 May 2007 14:52:43 +0200 Subject: [PATCH] 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 --- engines/mmap.c | 6 ++++++ 1 file changed, 6 insertions(+) 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)) { -- 2.25.1