libimage: report the size a removal actually frees #1105
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 189 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.314
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1105"
general
weight: 0.35
ROKUMATE
Fixes: https://github.com/podman-container-tools/podman/issues/27592
report.Sizeis the image's full size —i.Size()isstore.ImageSize(), which counts every layer including the shared ones. podman sums those reports, so a layer shared by N pruned images is counted N times. Users saw "reclaimed 346GB" on a 128GB disk.This adds
RemoveImageReport.FreedSize, the number of bytes the removal released.Sizekeeps its current meaning, so existing callers are unaffected.c/storage already walks the layer chain and stops at the first layer another image still references, so
DeleteImageWithSizereuses that walk and sums the layers it is about to remove, under the same lock that removes them. No second walk, no dry run, and no window in which a concurrent removal could skew the number. A layer shared by several removed images is released when the last of them goes, so it is accounted exactly once and summingFreedSizeover a removal gives the space it released.Layers are measured uncompressed, the same metric
DiskUsageuses, so the number stays comparable with whatpodman system dfreports.Tests: two images sharing a top layer are removed together; the summed
FreedSizeequals the disk usage measured before the removal, andsum(Size)is strictly greater. Reverting the accounting reports 11692362 against an actual 5848394.Podman needs a vendor bump and a switch from
r.Sizetor.FreedSizeinpkg/domain/infra/abi/images.go; PR to follow, with the bump as its own commit.