mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Protecting the read index is not out of bounds (#17226)
This commit is contained in:
parent
85912985b6
commit
f037c9b286
@ -221,16 +221,15 @@ func (s *erasureSets) connectDisks() {
|
||||
if disk.IsLocal() && disk.Healing() != nil {
|
||||
globalBackgroundHealState.pushHealLocalDisks(disk.Endpoint())
|
||||
}
|
||||
s.erasureDisksMu.RLock()
|
||||
s.erasureDisksMu.Lock()
|
||||
setIndex, diskIndex, err := findDiskIndex(s.format, format)
|
||||
s.erasureDisksMu.RUnlock()
|
||||
if err != nil {
|
||||
printEndpointError(endpoint, err, false)
|
||||
disk.Close()
|
||||
s.erasureDisksMu.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
s.erasureDisksMu.Lock()
|
||||
if currentDisk := s.erasureDisks[setIndex][diskIndex]; currentDisk != nil {
|
||||
if !reflect.DeepEqual(currentDisk.Endpoint(), disk.Endpoint()) {
|
||||
err = fmt.Errorf("Detected unexpected drive ordering refusing to use the drive: expecting %s, found %s, refusing to use the drive",
|
||||
|
Loading…
Reference in New Issue
Block a user