diff --git a/MODULE.bazel b/MODULE.bazel index 09ff2661..1aead589 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -95,10 +95,6 @@ go_deps_dev.module_override( patches = ["@com_github_buildbarn_bb_storage//:patches/com_github_grpc_ecosystem_go_grpc_prometheus/client-metrics-prevent-handled-twice.diff"], path = "github.com/grpc-ecosystem/go-grpc-prometheus", ) -go_deps_dev.module_override( - patches = ["//:patches/com_github_hanwen_go_fuse_v2/writeback-cache.diff"], - path = "github.com/hanwen/go-fuse/v2", -) go_deps_dev.module_override( patches = ["@com_github_buildbarn_bb_storage//:patches/org_golang_x_lint/generic.diff"], path = "golang.org/x/lint", diff --git a/patches/com_github_hanwen_go_fuse_v2/writeback-cache.diff b/patches/com_github_hanwen_go_fuse_v2/writeback-cache.diff deleted file mode 100644 index 4a29f989..00000000 --- a/patches/com_github_hanwen_go_fuse_v2/writeback-cache.diff +++ /dev/null @@ -1,32 +0,0 @@ -diff --git fuse/api.go fuse/api.go -index 4659a5b..42e1142 100644 ---- fuse/api.go -+++ fuse/api.go -@@ -301,6 +301,13 @@ type MountOptions struct { - // for more details. - SyncRead bool - -+ // Let the kernel use the writeback cache mode, as opposed to -+ // write-through mode. -+ // -+ // See the following page for more details: -+ // https://www.kernel.org/doc/Documentation/filesystems/fuse-io.txt -+ EnableWritebackCache bool -+ - // DirectMount, if set, makes go-fuse first attempt to use syscall.Mount instead of - // fusermount to mount the filesystem. This will not update /etc/mtab - // but might be needed if fusermount is not available. -diff --git fuse/opcode.go fuse/opcode.go -index 98bf8a9..e1c4128 100644 ---- fuse/opcode.go -+++ fuse/opcode.go -@@ -111,6 +111,9 @@ func doInit(server *protocolServer, req *request) { - if server.opts.EnableSymlinkCaching { - kernelFlags |= CAP_CACHE_SYMLINKS - } -+ if server.opts.EnableWritebackCache { -+ server.kernelSettings.Flags |= CAP_WRITEBACK_CACHE -+ } - if server.opts.EnableAcl { - kernelFlags |= CAP_POSIX_ACL - } diff --git a/pkg/filesystem/virtual/configuration/fuse_mount_enabled.go b/pkg/filesystem/virtual/configuration/fuse_mount_enabled.go index ceebaf87..2a0d4aa9 100644 --- a/pkg/filesystem/virtual/configuration/fuse_mount_enabled.go +++ b/pkg/filesystem/virtual/configuration/fuse_mount_enabled.go @@ -64,7 +64,7 @@ func (m *fuseMount) Expose(terminationGroup program.Group, rootDirectory virtual // writes. This means data is only guaranteed to // make it into the virtual file system after // calling close()/fsync()/munmap()/msync(). - EnableWritebackCache: true, + ExtraCapabilities: go_fuse.CAP_WRITEBACK_CACHE, // Cap the FUSE asynchronous request queue. When zero, // go-fuse falls back to its default of 12. MaxBackground: int(m.configuration.MaximumBackgroundTasks),