mirror of
https://github.com/minio/minio.git
synced 2024-12-25 22:55:54 -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 {
|
if disk.IsLocal() && disk.Healing() != nil {
|
||||||
globalBackgroundHealState.pushHealLocalDisks(disk.Endpoint())
|
globalBackgroundHealState.pushHealLocalDisks(disk.Endpoint())
|
||||||
}
|
}
|
||||||
s.erasureDisksMu.RLock()
|
s.erasureDisksMu.Lock()
|
||||||
setIndex, diskIndex, err := findDiskIndex(s.format, format)
|
setIndex, diskIndex, err := findDiskIndex(s.format, format)
|
||||||
s.erasureDisksMu.RUnlock()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
printEndpointError(endpoint, err, false)
|
printEndpointError(endpoint, err, false)
|
||||||
disk.Close()
|
disk.Close()
|
||||||
|
s.erasureDisksMu.Unlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
s.erasureDisksMu.Lock()
|
|
||||||
if currentDisk := s.erasureDisks[setIndex][diskIndex]; currentDisk != nil {
|
if currentDisk := s.erasureDisks[setIndex][diskIndex]; currentDisk != nil {
|
||||||
if !reflect.DeepEqual(currentDisk.Endpoint(), disk.Endpoint()) {
|
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",
|
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