aboutsummaryrefslogtreecommitdiff
path: root/weed/command/mount_std.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-03-03 03:42:29 -0800
committerchrislu <chris.lu@gmail.com>2022-03-03 03:42:29 -0800
commitf51e20028a381390bf1356e2ccd181838059cde9 (patch)
tree5d8183742ff8ab19a35c1cbee72e3b1ed683b193 /weed/command/mount_std.go
parentdc0f48682c9ed9d9e9ac50c4f54b1fd1b18b52d2 (diff)
downloadseaweedfs-f51e20028a381390bf1356e2ccd181838059cde9.tar.xz
seaweedfs-f51e20028a381390bf1356e2ccd181838059cde9.zip
mount: avoid comma in mount options
fix https://github.com/chrislusf/seaweedfs/issues/2719
Diffstat (limited to 'weed/command/mount_std.go')
-rw-r--r--weed/command/mount_std.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index e53f9831e..dd07636fe 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -49,10 +49,10 @@ func runMount(cmd *Command, args []string) bool {
return false
}
- return RunMount2(&mountOptions, os.FileMode(umask))
+ return RunMount(&mountOptions, os.FileMode(umask))
}
-func RunMount2(option *MountOptions, umask os.FileMode) bool {
+func RunMount(option *MountOptions, umask os.FileMode) bool {
// basic checks
chunkSizeLimitMB := *mountOptions.chunkSizeLimitMB
@@ -142,6 +142,8 @@ func RunMount2(option *MountOptions, umask os.FileMode) bool {
return true
}
+ serverFriendlyName := strings.ReplaceAll(*option.filer, ",", "+")
+
// mount fuse
fuseMountOptions := &fuse.MountOptions{
AllowOther: *option.allowOthers,
@@ -151,7 +153,7 @@ func RunMount2(option *MountOptions, umask os.FileMode) bool {
MaxReadAhead: 1024 * 1024 * 2,
IgnoreSecurityLabels: false,
RememberInodes: false,
- FsName: *option.filer + ":" + filerMountRootPath,
+ FsName: serverFriendlyName + ":" + filerMountRootPath,
Name: "seaweedfs",
SingleThreaded: false,
DisableXAttrs: false,
@@ -183,7 +185,7 @@ func RunMount2(option *MountOptions, umask os.FileMode) bool {
fuseMountOptions.Options = append(fuseMountOptions.Options, "noapplexattr")
// fuseMountOptions.Options = append(fuseMountOptions.Options, "novncache") // need to test effectiveness
fuseMountOptions.Options = append(fuseMountOptions.Options, "slow_statfs")
- fuseMountOptions.Options = append(fuseMountOptions.Options, "volname="+*option.filer)
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "volname="+serverFriendlyName)
fuseMountOptions.Options = append(fuseMountOptions.Options, fmt.Sprintf("iosize=%d", ioSizeMB*1024*1024))
}