avoid concurrent reads and writes to opts.UserDefined (#14862)

do not modify opts.UserDefined after object-handler
has set all the necessary values, any mutation needed
should be done on a copy of this value not directly.

As there are other pieces of code that access opts.UserDefined
concurrently this becomes challenging.

fixes #14856
This commit is contained in:
Harshavardhana
2022-05-05 04:14:41 -07:00
committed by GitHub
parent 2b7e75e079
commit c7df1ffc6f
7 changed files with 53 additions and 55 deletions

View File

@@ -130,6 +130,9 @@ func getWriteQuorum(drive int) int {
return quorum
}
// CloneMSS is an exposed function of cloneMSS for gateway usage.
var CloneMSS = cloneMSS
// cloneMSS will clone a map[string]string.
// If input is nil an empty map is returned, not nil.
func cloneMSS(v map[string]string) map[string]string {