From: weiping zhang Date: Sat, 29 Jul 2017 08:47:59 +0000 (+0800) Subject: filesetup: keep OS_O_DIRECT flag when pre-allocating file X-Git-Tag: fio-3.0~16^2~3 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=6e344dc3445bfec0583072e82bea728ab8d54d58;ds=sidebyside filesetup: keep OS_O_DIRECT flag when pre-allocating file When direct=1 the file open for pre-allocation should also set OS_O_DIRECT so we fail earlier if the filesystem/file doesn't support direct operations. Signed-off-by: weiping zhang --- diff --git a/filesetup.c b/filesetup.c index 839aefc3..0e5599ab 100644 --- a/filesetup.c +++ b/filesetup.c @@ -146,6 +146,8 @@ static int extend_file(struct thread_data *td, struct fio_file *f) flags |= O_CREAT; if (new_layout) flags |= O_TRUNC; + if (td->o.odirect) + flags |= OS_O_DIRECT; #ifdef WIN32 flags |= _O_BINARY;