tar: Create a new xattrs file for each checksum#1578
tar: Create a new xattrs file for each checksum#1578cgwalters merged 1 commit intobootc-dev:mainfrom
Conversation
There was a problem hiding this comment.
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.
cgwalters
left a comment
There was a problem hiding this comment.
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 <ckyrouac@redhat.com>
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