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:
Harshavardhana 2021-06-09 11:14:47 -07:00 committed by GitHub
parent 8e9e028c0c
commit 0980554725
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,6 +221,9 @@ func (z *erasureServerPools) getServerPoolsAvailableSpace(ctx context.Context, b
continue
}
for _, disk := range zinfo {
if disk == nil {
continue
}
available += disk.Total - disk.Used
}
serverPools[i] = poolAvailableSpace{