Skip to content

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.

Support Linux file/dir ACL in weed mount (#8233)

Chris Lua04e8dd00b9a
diff --git a/weed/command/mount.go b/weed/command/mount.go
index 7407ad908a..b45233fb47 100644
--- a/weed/command/mount.go
+++ b/weed/command/mount.go
@@ -24,6 +24,7 @@ type MountOptions struct {
cacheSizeMBForRead *int64
dataCenter *string
allowOthers *bool
+ defaultPermissions *bool
umaskString *string
nonempty *bool
volumeServerAccess *string
@@ -86,6 +87,7 @@ func init() {
mountOptions.cacheMetaTtlSec = cmdMount.Flag.Int("cacheMetaTtlSec", 60, "metadata cache validity seconds")
mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center")
mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system")
+ mountOptions.defaultPermissions = cmdMount.Flag.Bool("defaultPermissions", true, "enforce permissions by the operating system")
mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111")
mountOptions.nonempty = cmdMount.Flag.Bool("nonempty", false, "allows the mounting over a non-empty directory")
mountOptions.volumeServerAccess = cmdMount.Flag.String("volumeServerAccess", "direct", "access volume servers by [direct|publicUrl|filerProxy]")
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index 369f2e7c7e..342f31009b 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -188,6 +188,9 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
//SyncRead: false, // set to false to enable the FUSE_CAP_ASYNC_READ capability
EnableAcl: true,
}
+ if *option.defaultPermissions {
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "default_permissions")
+ }
if *option.nonempty {
fuseMountOptions.Options = append(fuseMountOptions.Options, "nonempty")
}
@@ -216,8 +219,12 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
fuseMountOptions.Options = append(fuseMountOptions.Options, fmt.Sprintf("iosize=%d", ioSizeMB*1024*1024))
}
- fuseMountOptions.EnableWriteback = *option.writebackCache
- fuseMountOptions.EnableAsyncDio = *option.asyncDio
+ if option.writebackCache != nil {
+ fuseMountOptions.EnableWriteback = *option.writebackCache
+ }
+ if option.asyncDio != nil {
+ fuseMountOptions.EnableAsyncDio = *option.asyncDio
+ }
if option.cacheSymlink != nil && *option.cacheSymlink {
fuseMountOptions.EnableSymlinkCaching = true
}