align 32bit integers with atomic values in structs (#14344)

fixes #14341
This commit is contained in:
Harshavardhana 2022-02-17 15:22:26 -08:00 committed by GitHub
parent 5a0c0079a1
commit af3dc25dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -138,12 +138,13 @@ func (stats *HTTPAPIStats) Load() map[string]int {
// HTTPStats holds statistics information about // HTTPStats holds statistics information about
// HTTP requests made by all clients // HTTP requests made by all clients
type HTTPStats struct { type HTTPStats struct {
s3RequestsInQueue int32 // ref: https://golang.org/pkg/sync/atomic/#pkg-note-BUG
_ int32 // For 64 bits alignment
s3RequestsIncoming uint64
rejectedRequestsAuth uint64 rejectedRequestsAuth uint64
rejectedRequestsTime uint64 rejectedRequestsTime uint64
rejectedRequestsHeader uint64 rejectedRequestsHeader uint64
rejectedRequestsInvalid uint64 rejectedRequestsInvalid uint64
s3RequestsInQueue int32
s3RequestsIncoming uint64
currentS3Requests HTTPAPIStats currentS3Requests HTTPAPIStats
totalS3Requests HTTPAPIStats totalS3Requests HTTPAPIStats
totalS3Errors HTTPAPIStats totalS3Errors HTTPAPIStats

View File

@ -50,7 +50,8 @@ type setInfo struct {
// mrfState sncapsulates all the information // mrfState sncapsulates all the information
// related to the global background MRF. // related to the global background MRF.
type mrfState struct { 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 ctx context.Context
objectAPI ObjectLayer objectAPI ObjectLayer