mirror of
https://github.com/minio/minio.git
synced 2025-04-07 05:10:30 -04:00
fix: getServerPoolsAvailableSpace() shouldn't crash (#12478)
if one of the disk is offline then DiskInfo can be `nil` and crash in server pool.
This commit is contained in:
parent
8e9e028c0c
commit
0980554725
@ -221,6 +221,9 @@ func (z *erasureServerPools) getServerPoolsAvailableSpace(ctx context.Context, b
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, disk := range zinfo {
|
for _, disk := range zinfo {
|
||||||
|
if disk == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
available += disk.Total - disk.Used
|
available += disk.Total - disk.Used
|
||||||
}
|
}
|
||||||
serverPools[i] = poolAvailableSpace{
|
serverPools[i] = poolAvailableSpace{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user