1
mirror of https://github.com/rclone/rclone synced 2024-12-23 14:23:44 +01:00

cmount: use -o atomic_o_trunc to make sure O_TRUNC is supplied to Open()

This commit is contained in:
Nick Craig-Wood 2017-11-13 17:18:47 +00:00
parent 57a5c67729
commit 60cdcf784c

View File

@ -40,6 +40,11 @@ func mountOptions(device string, mountpoint string) (options []string) {
"-o", "fsname=" + device, "-o", "fsname=" + device,
"-o", "subtype=rclone", "-o", "subtype=rclone",
"-o", fmt.Sprintf("max_readahead=%d", mountlib.MaxReadAhead), "-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 { if mountlib.DebugFUSE {
options = append(options, "-o", "debug") options = append(options, "-o", "debug")