From 2332462e7821d2ebc579f8b4e8bd097449167a0c Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 7 Jan 2019 00:21:17 +0100 Subject: fusefrontend: Filter O_CREAT in mangleOpenFlags. --- internal/fusefrontend/fs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go index a0e9d9f..e379465 100644 --- a/internal/fusefrontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -124,6 +124,9 @@ func (fs *FS) mangleOpenFlags(flags uint32) (newFlags int) { // accesses. Running xfstests generic/013 on ext4 used to trigger lots of // EINVAL errors due to missing alignment. Just fall back to buffered IO. newFlags = newFlags &^ syscallcompat.O_DIRECT + // Create and Open are two separate FUSE operations, so O_CREAT should not + // be part of the open flags. + newFlags = newFlags &^ syscall.O_CREAT // We always want O_NOFOLLOW to be safe against symlink races newFlags |= syscall.O_NOFOLLOW return newFlags -- cgit v1.2.3