mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Fix locking in some admin APIs: (#5438)
- read lock for get config - write lock for update creds - write lock for format file
This commit is contained in:
committed by
Harshavardhana
parent
a003de72bf
commit
254b05e314
@@ -528,6 +528,13 @@ func (h *healSequence) healDiskFormat() error {
|
||||
return errServerNotInitialized
|
||||
}
|
||||
|
||||
// Acquire lock on format.json
|
||||
formatLock := globalNSMutex.NewNSLock(minioMetaBucket, formatConfigFile)
|
||||
if err := formatLock.GetLock(globalHealingTimeout); err != nil {
|
||||
return errFnHealFromAPIErr(err)
|
||||
}
|
||||
defer formatLock.Unlock()
|
||||
|
||||
// Create a new set of storage instances to heal format.json.
|
||||
bootstrapDisks, err := initStorageDisks(globalEndpoints)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user