Skip to content

fix(fs): prevent usage double-counting in OverlayFs#457

Merged
chaliy merged 1 commit intomainfrom
claude/fix-418-Y2nIj
Mar 2, 2026
Merged

fix(fs): prevent usage double-counting in OverlayFs#457
chaliy merged 1 commit intomainfrom
claude/fix-418-Y2nIj

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Mar 1, 2026

Summary

  • Track lower-layer entries hidden by upper overrides or whiteouts via lower_hidden accumulator
  • Deduct hidden entries in compute_usage() to avoid double-counting
  • Update write_file, append_file, remove, and chmod to maintain the accumulator

Test plan

  • test_usage_no_double_count_override - overriding a file doesn't inflate count
  • test_usage_deducts_whiteouts - deleting a lower file deducts its usage
  • test_usage_no_double_count_append_cow - CoW append adds only new bytes

Closes #418

@chaliy chaliy force-pushed the claude/fix-418-Y2nIj branch from 85dac6d to 66fa2da Compare March 2, 2026 00:14
compute_usage() previously summed upper + lower layer usage without
deducting overwritten or whited-out files. Add lower_hidden accumulator
that tracks hidden lower entries incrementally in write_file, remove,
append_file, and chmod. compute_usage now subtracts the hidden portion
from the lower contribution.

Closes #418

https://claude.ai/code/session_01WZjYqxm5xMPAEe7FSHJkDy
@chaliy chaliy force-pushed the claude/fix-418-Y2nIj branch from 66fa2da to b40a300 Compare March 2, 2026 00:17
@chaliy chaliy merged commit b73d5c5 into main Mar 2, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M-4] OverlayFs usage double-counts files across layers

2 participants