Check pool-index for invalid setups (#16501)

This commit is contained in:
Klaus Post
2023-01-30 14:03:07 +01:00
committed by GitHub
parent 67fce4a5b3
commit b923a62425
3 changed files with 20 additions and 0 deletions

View File

@@ -133,6 +133,11 @@ func (z *erasureServerPools) initRebalanceMeta(ctx context.Context, buckets []st
}, len(z.serverPools))
var totalCap, totalFree uint64
for _, disk := range si.Disks {
// Ignore invalid.
if disk.PoolIndex < 0 || len(diskStats) <= disk.PoolIndex {
// https://github.com/minio/minio/issues/16500
continue
}
totalCap += disk.TotalSpace
totalFree += disk.AvailableSpace