Ignore disks with 0 total space (#14981)

Ignore disks with 0 total

Mainly defensive to ensure no `/0` in percent calculation.
This commit is contained in:
Klaus Post 2022-05-26 06:01:50 -07:00 committed by GitHub
parent 1b7dd70f72
commit c0bf02b8b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -336,7 +336,7 @@ func (z *erasureServerPools) getServerPoolsAvailableSpace(ctx context.Context, b
}
var maxUsedPct int
for _, disk := range zinfo {
if disk == nil {
if disk == nil || disk.Total == 0 {
continue
}
available += disk.Total - disk.Used