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
Package upgrades break if hardlinks got added #1278
Comments
With --force, if something breaks you get to keep the pieces. Is it reproducable without --force? |
Yes. I only used |
I ran the commands again without |
Ok, thanks for verifying. Just FWIW, --oldpackage is the "appropriate" flag for downgrades, --force is the BFH usually best left in the toolshed 😁 |
Just found out that this only happens with
vs.
|
Ah... makes sense. Thanks for spotting that! |
The existing FSM code doesn't correctly handle FA_TOUCH on hardlinked file sets, which causes the hardlink set to break on at least some upgrade scenarios when minimize_writes is enabled. Only enable FA_TOUCH on non-hardlinked files to work around the issue for now. While at it, rearrange the conditionals around min_writes to make it a bit clearer. Testcase adopted from original reproducer by Fabian Vogt, thanks! Fixes: rpm-software-management#1278
The existing FSM code doesn't correctly handle FA_TOUCH on hardlinked file sets, which causes the hardlink set to break on at least some upgrade scenarios when minimize_writes is enabled. Only enable FA_TOUCH on non-hardlinked files to work around the issue for now. While at it, rearrange the conditionals around min_writes to make it a bit clearer. Testcase adopted from original reproducer by Fabian Vogt, thanks! Fixes: #1278
Thanks for reporting and the nice reproducer! |
Thanks for the quick fix! |
The existing FSM code doesn't correctly handle FA_TOUCH on hardlinked file sets, which causes the hardlink set to break on at least some upgrade scenarios when minimize_writes is enabled. Only enable FA_TOUCH on non-hardlinked files to work around the issue for now. While at it, rearrange the conditionals around min_writes to make it a bit clearer. Testcase adopted from original reproducer by Fabian Vogt, thanks! Fixes: rpm-software-management#1278 (cherry picked from commit 4017582)
The existing FSM code doesn't correctly handle FA_TOUCH on hardlinked file sets, which causes the hardlink set to break on at least some upgrade scenarios when minimize_writes is enabled. Only enable FA_TOUCH on non-hardlinked files to work around the issue for now. While at it, rearrange the conditionals around min_writes to make it a bit clearer. Testcase adopted from original reproducer by Fabian Vogt, thanks! Fixes: #1278 (cherry picked from commit 4017582)
The algorithm used for installing hardlinks does not handle the case where a package upgrade includes additional names for an inode. It iterates the list of files from the beginning until the end and only writes content and metadata for the last occurence of an inode.
For upgrades, there is no hardlink relationship though, the added file has a different inode. This means that the content and metadata are written only to the files from the old package.As the file content didn't change, the other names for the inode verify successfully and are thus not written to, so neither recreated as hardlinks to the new file nor file content written into the inode.
Reproducer:
To build:
To install:
As you can see,
/usr/file1
was created with wrong mode and no content. The two files do not share an inode. It works if the package is installed directly:The text was updated successfully, but these errors were encountered: