Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Btrfs reflinks make allocated-byte sums count the same storage repeatedly, and selected tile sizes do not reliably predict space freed by deletion. This adds unprivileged extent accounting for local Btrfs scans and separates treemap contributions from conservative reclaim estimates. In the real-filesystem regression, three 1 MiB reflinked files contribute 1 MiB to the tree and promise no saving while their data is shared.
This deliberately remains conservative: selecting all visible reflink copies does not prove that no snapshot or unscanned reference exists. Exact compressed physical sizes are not available through unprivileged FIEMAP. SSH scans retain their existing accounting. The extra pass adds metadata I/O and the node size increases from 88 to 104 bytes; no privileged helper or new runtime dependency is introduced.
Validation on Linux aarch64, Rust 1.97:
cargo xtask lintpasses.DISKTREE_BTRFS_TEST_DIR=/path/on/btrfs cargo test --workspace -j 2: 274 passed, 9 existing tests ignored. This includes the real reflink, compression, sparse-file, unreadable-file and window-harness checks.