From e3c11c9ca16f515026650020c7afaad90a167d7d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 4 Feb 2020 10:21:07 +0000 Subject: [PATCH] mount: add --async-read flag to disable asynchronous reads See: https://forum.rclone.org/t/constantly-high-iowait-add-log/14156 --- cmd/mount/mount.go | 4 +++- cmd/mountlib/mount.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/mount/mount.go b/cmd/mount/mount.go index 8a496aefc..15e59b47b 100644 --- a/cmd/mount/mount.go +++ b/cmd/mount/mount.go @@ -32,12 +32,14 @@ func mountOptions(device string) (options []fuse.MountOption) { fuse.Subtype("rclone"), fuse.FSName(device), fuse.VolumeName(mountlib.VolumeName), - fuse.AsyncRead(), // Options from benchmarking in the fuse module //fuse.MaxReadahead(64 * 1024 * 1024), //fuse.WritebackCache(), } + if mountlib.AsyncRead { + options = append(options, fuse.AsyncRead()) + } if mountlib.NoAppleDouble { options = append(options, fuse.NoAppleDouble()) } diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.go index 30d30dda6..0b6eadebe 100644 --- a/cmd/mountlib/mount.go +++ b/cmd/mountlib/mount.go @@ -36,6 +36,7 @@ var ( NoAppleDouble = true // use noappledouble by default NoAppleXattr = false // do not use noapplexattr by default DaemonTimeout time.Duration // OSXFUSE only + AsyncRead = true // do async reads by default ) // Global constants @@ -356,6 +357,7 @@ be copied to the vfs cache before opening with --vfs-cache-mode full. flags.BoolVarP(cmdFlags, &Daemon, "daemon", "", Daemon, "Run mount as a daemon (background mode).") flags.StringVarP(cmdFlags, &VolumeName, "volname", "", VolumeName, "Set the volume name (not supported by all OSes).") flags.DurationVarP(cmdFlags, &DaemonTimeout, "daemon-timeout", "", DaemonTimeout, "Time limit for rclone to respond to kernel (not supported by all OSes).") + flags.BoolVarP(cmdFlags, &AsyncRead, "async-read", "", AsyncRead, "Use asynchronous reads.") if runtime.GOOS == "darwin" { flags.BoolVarP(cmdFlags, &NoAppleDouble, "noappledouble", "", NoAppleDouble, "Sets the OSXFUSE option noappledouble.")