aboutsummaryrefslogtreecommitdiff
path: root/weed/server/filer_server_handlers_write.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/server/filer_server_handlers_write.go')
-rw-r--r--weed/server/filer_server_handlers_write.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/weed/server/filer_server_handlers_write.go b/weed/server/filer_server_handlers_write.go
index a7bd73c35..ae9c46fb2 100644
--- a/weed/server/filer_server_handlers_write.go
+++ b/weed/server/filer_server_handlers_write.go
@@ -254,8 +254,10 @@ func (fs *FilerServer) detectStorageOption(ctx context.Context, requestURI, qCol
return nil, ErrReadOnly
}
- if rule.MaxFileNameLength == 0 {
- rule.MaxFileNameLength = fs.filer.MaxFilenameLength
+ // Use local variable instead of mutating shared rule
+ maxFileNameLength := rule.MaxFileNameLength
+ if maxFileNameLength == 0 {
+ maxFileNameLength = fs.filer.MaxFilenameLength
}
// required by buckets folder
@@ -282,7 +284,7 @@ func (fs *FilerServer) detectStorageOption(ctx context.Context, requestURI, qCol
DiskType: util.Nvl(diskType, rule.DiskType),
Fsync: rule.Fsync,
VolumeGrowthCount: rule.VolumeGrowthCount,
- MaxFileNameLength: rule.MaxFileNameLength,
+ MaxFileNameLength: maxFileNameLength,
}, nil
}