mirror of
https://github.com/minio/minio.git
synced 2025-02-26 04:49:16 -05:00
fix: reading from erasureDisks must be protected via read lock() (#16407)
This commit is contained in:
parent
b204c2dbec
commit
c8e1154f1e
@ -187,10 +187,8 @@ func (z *erasureServerPools) GetDisksID(ids ...string) []StorageAPI {
|
|||||||
}
|
}
|
||||||
res := make([]StorageAPI, 0, len(idMap))
|
res := make([]StorageAPI, 0, len(idMap))
|
||||||
for _, s := range z.serverPools {
|
for _, s := range z.serverPools {
|
||||||
s.erasureDisksMu.RLock()
|
for _, set := range s.sets {
|
||||||
defer s.erasureDisksMu.RUnlock()
|
for _, disk := range set.getDisks() {
|
||||||
for _, disks := range s.erasureDisks {
|
|
||||||
for _, disk := range disks {
|
|
||||||
if disk == OfflineDisk {
|
if disk == OfflineDisk {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -211,8 +209,8 @@ func (z *erasureServerPools) GetDisksID(ids ...string) []StorageAPI {
|
|||||||
func (z *erasureServerPools) GetRawData(ctx context.Context, volume, file string, fn func(r io.Reader, host string, disk string, filename string, info StatInfo) error) error {
|
func (z *erasureServerPools) GetRawData(ctx context.Context, volume, file string, fn func(r io.Reader, host string, disk string, filename string, info StatInfo) error) error {
|
||||||
found := 0
|
found := 0
|
||||||
for _, s := range z.serverPools {
|
for _, s := range z.serverPools {
|
||||||
for _, disks := range s.erasureDisks {
|
for _, set := range s.sets {
|
||||||
for _, disk := range disks {
|
for _, disk := range set.getDisks() {
|
||||||
if disk == OfflineDisk {
|
if disk == OfflineDisk {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user