Repository navigation
fix(backup): keep readable xattrs and report incomplete metadata - #661
Open
akatsukiwork0320 wants to merge 1 commit into
Open
akatsukiwork0320 wants to merge 1 commit into
akatsukiwork0320 wants to merge 1 commit into
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.
Closes #596
A failed extended-attribute read currently discards every attribute already collected for the entry. The file can still be restored, but the caller sees zero source errors. This patch keeps the file and each readable attribute, continues past failed value reads, and reports the first error for each affected entry through the existing progress callback and snapshot summary.
If listing attributes returns
Unsupported, the entry contributes zero errors. This preserves backups from mounts without xattr support, as intended by #233. Once a name has been listed, a failure to read its value counts as incomplete metadata, including when that read returnsUnsupported.Previously, if an attribute disappeared between listing and reading, the snapshot kept its name with no value. The patch omits that name without counting an error. An attribute that is present with a zero-length value is still saved.
Verification
On Linux, the test backed up mode
0644files from a read-only FUSE mount and restored them to a fresh directory as an ordinary user. The counts below come from the backup return value and a separate lookup of the saved snapshot by ID. The three named attributes, in order, werealpha,betaandgammain theuser.rustic_namespace.EOPNOTSUPPfor four files and one directorybetareturnsEACCESalpha,gammabetareturnsEOPNOTSUPPalpha,gammabetaandgammaboth returnEACCESalphaThe readable attribute values matched in the saved snapshot and at the
0644destination. In a separate0444case, the snapshot contained both readable values and the restored file contents matched. The unprivileged restore left both attributes absent, and a directuser.*write on that destination returnedEACCES.On Linux with Rust 1.99.0, the patched tree at
bf1de63passed all 325 core tests. The workspace run with all targets and features passed 365 tests. Formatting, spelling, Clippy with-D warningsand the workspace documentation build also passed. The macOS and Windows runs below used Rust 1.100.0.On macOS 26.7.2 (arm64, APFS), all 365 workspace tests passed and the documentation built successfully. With the original
chmod +a "everyone deny readextattr" ffrom #596, both listing the attributes and readingcom.example.kdirectly returnedEACCES. The restored file matched the original bytes, the attribute was absent, and the returned and reloaded summaries both recorded one error. In the earlier macOS 15.8.2 comparison on the same base, upstream restored the file with 0/0 and the #613 mapper omitted it with 1/1. Earlier proposal #613On Windows Server 2025 (x86-64), all 288 workspace tests passed and the documentation built successfully. A separate backup and restore of an ordinary binary file reproduced its bytes exactly. The backup return value and the snapshot reloaded by ID both reported zero errors. This Windows check covered ordinary file contents only.
AI tools assisted with the patch, test execution and PR text.