Enable writeback_cache and async_dio FUSE options (#7980)

* Enable writeback_cache and async_dio FUSE options

Fixes #7978

- Update mount_std.go to use EnableWriteback and EnableAsyncDio from go-fuse
- Add go.mod replace directive to use local go-fuse with capability support
- Remove temporary workaround that disabled these options

This enables proper FUSE kernel capability negotiation for writeback cache
and async direct I/O, improving performance for small writes and concurrent
direct I/O operations.

* Address PR review comments

- Remove redundant nil checks for writebackCache and asyncDio flags
- Update go.mod replace directive to use seaweedfs/go-fuse fork instead of local path

* Add TODO comment for go.mod replace directive

The replace directive must use a local path until seaweedfs/go-fuse#1 is merged.
After merge, this should be updated to use the proper version.

* Use seaweedfs/go-fuse v2.9.0 instead of local repository

Replace local path with seaweedfs/go-fuse v2.9.0 fork which includes
the writeback_cache and async_dio capability support.

* Use github.com/seaweedfs/go-fuse/v2 directly without replace directive

- Updated all imports to use github.com/seaweedfs/go-fuse/v2
- Removed replace directive from go.mod
- Using seaweedfs/go-fuse v2.0.0-20260106181308-87f90219ce09 which includes:
  * writeback_cache and async_dio support
  * Corrected module path

* Update to seaweedfs/go-fuse v2.9.1

Use v2.9.1 tag which includes the corrected module path
(github.com/seaweedfs/go-fuse/v2) along with writeback_cache
and async_dio support.
This commit is contained in:
Chris Lu
2026-01-06 10:50:54 -08:00
committed by GitHub
parent e10f11b480
commit d4ecfaeda7
29 changed files with 34 additions and 38 deletions

View File

@@ -18,7 +18,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util/version"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/mount"
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
@@ -216,12 +216,8 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
fuseMountOptions.Options = append(fuseMountOptions.Options, fmt.Sprintf("iosize=%d", ioSizeMB*1024*1024))
}
if option.writebackCache != nil && *option.writebackCache {
fuseMountOptions.Options = append(fuseMountOptions.Options, "writeback_cache")
}
if option.asyncDio != nil && *option.asyncDio {
fuseMountOptions.Options = append(fuseMountOptions.Options, "async_dio")
}
fuseMountOptions.EnableWriteback = *option.writebackCache
fuseMountOptions.EnableAsyncDio = *option.asyncDio
if option.cacheSymlink != nil && *option.cacheSymlink {
fuseMountOptions.EnableSymlinkCaching = true
}

View File

@@ -4,7 +4,7 @@ import (
"strings"
"syscall"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

View File

@@ -4,7 +4,7 @@ import (
"sync"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util"
)

View File

@@ -10,7 +10,7 @@ import (
"sync/atomic"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"google.golang.org/grpc"
"github.com/seaweedfs/seaweedfs/weed/filer"
@@ -26,7 +26,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util/version"
"github.com/seaweedfs/seaweedfs/weed/wdclient"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/seaweedfs/go-fuse/v2/fs"
)
type Option struct {

View File

@@ -5,7 +5,7 @@ import (
"syscall"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"

View File

@@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
)
func setBlksize(out *fuse.Attr, size uint32) {

View File

@@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
)
func setBlksize(out *fuse.Attr, size uint32) {

View File

@@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
)
func setBlksize(out *fuse.Attr, size uint32) {

View File

@@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"

View File

@@ -8,7 +8,7 @@ import (
"syscall"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"

View File

@@ -4,7 +4,7 @@ import (
"context"
"sync"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"

View File

@@ -4,7 +4,7 @@ import (
"net/http"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util"

View File

@@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
)

View File

@@ -6,7 +6,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"

View File

@@ -6,7 +6,7 @@ import (
"syscall"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"

View File

@@ -8,7 +8,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
)

View File

@@ -6,7 +6,7 @@ import (
"syscall"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"

View File

@@ -5,7 +5,7 @@ import (
"syscall"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util"
)

View File

@@ -1,7 +1,7 @@
package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)

View File

@@ -6,7 +6,7 @@ import (
"syscall"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"

View File

@@ -7,8 +7,8 @@ import (
"strings"
"syscall"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fs"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"

View File

@@ -3,7 +3,7 @@ package mount
import (
"context"
"fmt"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"math"

View File

@@ -7,7 +7,7 @@ import (
"syscall"
"time"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"

View File

@@ -1,6 +1,6 @@
package mount
import "github.com/hanwen/go-fuse/v2/fuse"
import "github.com/seaweedfs/go-fuse/v2/fuse"
// https://github.com/libfuse/libfuse/blob/48ae2e72b39b6a31cb2194f6f11786b7ca06aac6/include/fuse.h#L778

View File

@@ -8,7 +8,7 @@ import (
"strings"
"syscall"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
sys "golang.org/x/sys/unix"
)

View File

@@ -3,7 +3,7 @@ package mount
import (
"syscall"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
)
func (wfs *WFS) GetXAttr(cancel <-chan struct{}, header *fuse.InHeader, attr string, dest []byte) (size uint32, code fuse.Status) {

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"syscall"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"