-
Notifications
You must be signed in to change notification settings - Fork 143
tar: Create a new xattrs file for each checksum #1578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a mechanism to handle a large number of links to the same xattrs object by creating duplicate xattrs files with a suffix, which is a good approach to avoid hitting filesystem link limits. The implementation adds tracking for link counts and creates new suffixed files when a limit is reached. The changes are mostly in append_ostree_xattrs and are accompanied by new tests.
My review identifies a potential logic bug in the new implementation that could cause issues if a suffixed xattrs file already exists when it's being created. I've suggested a refactoring that fixes this bug and improves efficiency. I also have a minor suggestion to improve test failure diagnostics. Overall, the change is in the right direction but needs a small correction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The export changes look sane to me. Can you do a before/after comparison on sizes just as a sanity check?
Honestly it could very well be that this saves space because I bet the xattr data is smaller than the file path in the hardlink...
This removes the code from export that links duplicate xattrs to a single xattrs file. This is to avoid creating too many (over 65,000) hardlinks to a single file. This might cause some image sizes to increase, however compression should limit the size increase. This is accomplished by creating the file-xattrs-link file directly, instead of creating it as a link. This is to support backwards compatibility in import.rs Assisted-by: Claude Code Signed-off-by: ckyrouac <[email protected]>
The With links: 1917.763676 MB |
|
Thanks for confirming that, very helpful to know. |
This is to avoid creating (10s of) thousands of links to a single file which will cause the rechunker to fail after passing the filesystem's link limit. This will create a duplicate xattrs file to link to for each chunk of 256 links.
Assisted-by: Claude Code
Fixes coreos/rpm-ostree#5479