From 12be07bb8330b6cfd11e0021e4ffbf21b78296c7 Mon Sep 17 00:00:00 2001 From: Mindaugas Rasiukevicius Date: Wed, 4 Mar 2020 21:55:59 +0000 Subject: [PATCH] rvaultfs: disable direct_io on Darwin; rely on the 'noubc' option. (#35) --- src/fuse/rvaultfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fuse/rvaultfs.c b/src/fuse/rvaultfs.c index 696ed06..ad19e83 100644 --- a/src/fuse/rvaultfs.c +++ b/src/fuse/rvaultfs.c @@ -118,9 +118,14 @@ rvaultfs_open_raw(const char *path, struct fuse_file_info *fi, mode_t mode) return -errno; } - /* Just use direct I/O i.e. bypass page cache. */ + /* + * Use direct I/O i.e. bypass the page cache for extra security. + * This causes abnormal behaviour on Darwin, though; we use the + * '-noubc' parameter there instead. + */ +#if !defined(__APPLE__) fi->direct_io = true; - fi->keep_cache = false; +#endif /* Associate the file object with the FUSE file handle. */ static_assert(sizeof(fi->fh) >= sizeof(uintptr_t),