SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
remove the direct_io flag, as it is not well-supported on macOS
chrislu113c9ce6a83e
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.goindex 0ab794bbd6..365a65c6d1 100644--- a/weed/command/mount_std.go+++ b/weed/command/mount_std.go@@ -248,6 +248,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {Cipher: cipher,UidGidMapper: uidGidMapper,DisableXAttr: *option.disableXAttr,+ IsMacOs: runtime.GOOS == "darwin",})// create mount rootdiff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.goindex ac665ce5e7..728777e324 100644--- a/weed/mount/weedfs.go+++ b/weed/mount/weedfs.go@@ -46,6 +46,7 @@ type Option struct {Umask os.FileModeQuota int64DisableXAttr bool+ IsMacOs boolMountUid uint32MountGid uint32diff --git a/weed/mount/weedfs_file_io.go b/weed/mount/weedfs_file_io.goindex 50a5c7c853..04fe7f21cc 100644--- a/weed/mount/weedfs_file_io.go+++ b/weed/mount/weedfs_file_io.go@@ -2,6 +2,7 @@ package mountimport ("github.com/hanwen/go-fuse/v2/fuse"+ "github.com/seaweedfs/seaweedfs/weed/glog")/**@@ -66,6 +67,14 @@ func (wfs *WFS) Open(cancel <-chan struct{}, in *fuse.OpenIn, out *fuse.OpenOut)if status == fuse.OK {out.Fh = uint64(fileHandle.fh)out.OpenFlags = in.Flags+ if wfs.option.IsMacOs {+ // remove the direct_io flag, as it is not well-supported on macOS+ // https://code.google.com/archive/p/macfuse/wikis/OPTIONS.wiki recommended to avoid the direct_io flag+ if in.Flags&fuse.FOPEN_DIRECT_IO != 0 {+ glog.V(4).Infof("macfuse direct_io mode %v => false\n", in.Flags&fuse.FOPEN_DIRECT_IO != 0)+ out.OpenFlags &^= fuse.FOPEN_DIRECT_IO+ }+ }// TODO https://github.com/libfuse/libfuse/blob/master/include/fuse_common.h#L64}return status