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.

fix(command): preserve fuse option after writers (#9972)

7y-93bf3d290581f
diff --git a/weed/command/fuse_std.go b/weed/command/fuse_std.go
index 2e4c88f87d..1eb4ee072b 100644
--- a/weed/command/fuse_std.go
+++ b/weed/command/fuse_std.go
@@ -165,7 +165,6 @@ func runFuse(cmd *Command, args []string) bool {
panic(fmt.Errorf("dirIdleEvictSec: %s", err))
}
case "concurrentWriters":
- i++
if parsed, err := strconv.ParseInt(parameter.value, 0, 32); err == nil {
intValue := int(parsed)
mountOptions.concurrentWriters = &intValue
diff --git a/weed/command/fuse_std_test.go b/weed/command/fuse_std_test.go
new file mode 100644
index 0000000000..64122bb3c6
--- /dev/null
+++ b/weed/command/fuse_std_test.go
@@ -0,0 +1,38 @@
+//go:build darwin || freebsd || linux
+
+package command
+
+import (
+ "fmt"
+ "strings"
+ "testing"
+)
+
+func TestRunFuseDoesNotSkipOptionAfterConcurrentWriters(t *testing.T) {
+ oldUmask := mountOptions.umaskString
+ oldWriters := mountOptions.concurrentWriters
+ oldReaders := mountOptions.concurrentReaders
+ oldFuseCommandPid := mountOptions.fuseCommandPid
+ oldDir := mountOptions.dir
+ defer func() {
+ mountOptions.umaskString = oldUmask
+ mountOptions.concurrentWriters = oldWriters
+ mountOptions.concurrentReaders = oldReaders
+ mountOptions.fuseCommandPid = oldFuseCommandPid
+ mountOptions.dir = oldDir
+
+ recovered := recover()
+ if recovered == nil {
+ t.Fatal("expected invalid concurrentReaders option to be parsed")
+ }
+ if !strings.Contains(fmt.Sprint(recovered), "concurrentReaders") {
+ t.Fatalf("expected concurrentReaders parse error, got %v", recovered)
+ }
+ }()
+
+ runFuse(cmdMount, []string{
+ "/mnt",
+ "-o",
+ "child=1,concurrentWriters=2,concurrentReaders=bad,umask=bad",
+ })
+}