From af3dc25dfe9866c20c76945f0455b00b14f1e36c Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 17 Feb 2022 15:22:26 -0800 Subject: [PATCH] align 32bit integers with atomic values in structs (#14344) fixes #14341 --- cmd/http-stats.go | 5 +++-- cmd/mrf.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/http-stats.go b/cmd/http-stats.go index 980a6e828..9041d4bc9 100644 --- a/cmd/http-stats.go +++ b/cmd/http-stats.go @@ -138,12 +138,13 @@ func (stats *HTTPAPIStats) Load() map[string]int { // HTTPStats holds statistics information about // HTTP requests made by all clients type HTTPStats struct { + s3RequestsInQueue int32 // ref: https://golang.org/pkg/sync/atomic/#pkg-note-BUG + _ int32 // For 64 bits alignment + s3RequestsIncoming uint64 rejectedRequestsAuth uint64 rejectedRequestsTime uint64 rejectedRequestsHeader uint64 rejectedRequestsInvalid uint64 - s3RequestsInQueue int32 - s3RequestsIncoming uint64 currentS3Requests HTTPAPIStats totalS3Requests HTTPAPIStats totalS3Errors HTTPAPIStats diff --git a/cmd/mrf.go b/cmd/mrf.go index c7df7a20d..18fa6d193 100644 --- a/cmd/mrf.go +++ b/cmd/mrf.go @@ -50,7 +50,8 @@ type setInfo struct { // mrfState sncapsulates all the information // related to the global background MRF. type mrfState struct { - ready int32 + ready int32 // ref: https://golang.org/pkg/sync/atomic/#pkg-note-BUG + _ int32 // For 64 bits alignment ctx context.Context objectAPI ObjectLayer