Merge pull request #51128 from thaJeztah/28.x_backport_gcpolicy-invalid-calculations

[28.x backport] builder: use proper percentage calculations for default gc policy
This commit is contained in:
Austin Vazquez
2025-10-07 13:56:48 -07:00
committed by GitHub

View File

@@ -72,6 +72,6 @@ func DefaultGCPolicy(p string, reservedSpace, maxUsedSpace, minFreeSpace int64)
}
func diskPercentage(dstat disk.DiskStat, percentage int64) int64 {
avail := dstat.Total / percentage
avail := dstat.Total * percentage / 100
return (avail/(1<<30) + 1) * 1e9 // round up
}