Merge pull request #51125 from jsternberg/gcpolicy-invalid-calculations

builder: use proper percentage calculations for default gc policy
This commit is contained in:
Sebastiaan van Stijn
2025-10-07 19:07:31 +02: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
}