From 6e344dc3445bfec0583072e82bea728ab8d54d58 Mon Sep 17 00:00:00 2001 From: weiping zhang Date: Sat, 29 Jul 2017 16:47:59 +0800 Subject: [PATCH] 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 --- filesetup.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.25.1