From: Sitsofe Wheeler Date: Thu, 27 Jul 2017 04:50:41 +0000 (+0100) Subject: init: force fallocate_mode to none when fallocate is unsupported X-Git-Tag: fio-3.0~27^2~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=d27f75b8ac13a4056cc8ef09b56de9dd184a2ad1 init: force fallocate_mode to none when fallocate is unsupported Commit 2c3e17be ("filesetup: add native fallocate") broke fio on Windows because fallocate_mode wound up being set to 0 on platforms without any type of fallocate. Work around this by forcing fallocate_mode to FIO_FALLOCATE_NONE on such platforms. This should address the issue mention in the mail http://www.spinics.net/lists/fio/msg06085.html ("The commit 'filesetup: add native fallocate' breaks on Cygwin"). Signed-off-by: Sitsofe Wheeler --- diff --git a/init.c b/init.c index 90cc0bcf..52560ed3 100644 --- a/init.c +++ b/init.c @@ -781,6 +781,11 @@ static int fixup_options(struct thread_data *td) o->unit_base = 8; } +#if !defined(CONFIG_POSIX_FALLOCATE) && !defined(FIO_HAVE_NATIVE_FALLOCATE) + /* Platform doesn't support fallocate so force set it to none */ + o->fallocate_mode = FIO_FALLOCATE_NONE; +#endif + #ifndef CONFIG_FDATASYNC if (o->fdatasync_blocks) { log_info("fio: this platform does not support fdatasync()"