From 60cdcf784cb75867d3dbaf43eaaa4f18916b318d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 13 Nov 2017 17:18:47 +0000 Subject: [PATCH] cmount: use -o atomic_o_trunc to make sure O_TRUNC is supplied to Open() --- cmd/cmount/mount.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.go index 8c482b53a..647ea33a5 100644 --- a/cmd/cmount/mount.go +++ b/cmd/cmount/mount.go @@ -40,6 +40,11 @@ func mountOptions(device string, mountpoint string) (options []string) { "-o", "fsname=" + device, "-o", "subtype=rclone", "-o", fmt.Sprintf("max_readahead=%d", mountlib.MaxReadAhead), + // This causes FUSE to supply O_TRUNC with the Open + // call which is more efficient for cmount. However + // it does not work with cgofuse on Windows with + // WinFSP so cmount must work with or without it. + "-o", "atomic_o_trunc", } if mountlib.DebugFUSE { options = append(options, "-o", "debug")