tests: fix inode-order dependence in test_multiple_link_exclusion, fixes #8740 - #10152
Merged
ThomasWaldmann merged 1 commit intoAug 18, 2026
Merged
Conversation
borgbackup#8740 create processes directory entries in inode order (scandir_inorder), so which of the two hardlinks becomes the hardlink master depends on the inode numbers the filesystem assigned to the dirs a and b. On linux ext4 these follow creation order, but e.g. FreeBSD ufs dirpref spreads new dirs over cylinder groups, so b may get a lower inode than a - then b/hardlink became the master and diff of only input/b succeeded (rc 0) instead of warning about the excluded hardlink source (rc 1). Determine master/slave from the actual dir inode numbers and exclude the master's dir, making the test work on any filesystem. Also drop the FreeBSD/NetBSD skip: this failure was traversal-order dependence, not the ctime quirks of borgbackup#9147/borgbackup#9153. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.4-maint #10152 +/- ##
=============================================
- Coverage 82.62% 82.11% -0.52%
=============================================
Files 38 38
Lines 11432 11435 +3
Branches 1803 1802 -1
=============================================
- Hits 9446 9390 -56
- Misses 1408 1460 +52
- Partials 578 585 +7 ☔ View full report in Codecov by Harness. |
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.
Fixes #8740.
borg createprocesses directory entries in inode order (scandir_inorder), so which of the two hardlinks becomes the hardlink master depends on the inode numbers the filesystem assigned to the dirsaandb. On linux ext4 these follow creation order, but e.g. FreeBSD ufs dirpref spreads new directories over cylinder groups, sobmay get a lower inode thana— thenb/hardlinkbecame the master (with chunks) anddiffrestricted toinput/bcompared it successfully and printed just the ctime change (rc 0, exactly the output captured in the issue), instead of warning about the excluded hardlink source (rc 1). Same class of behavior on OpenIndiana.The fix determines master/slave from the actual dir inode numbers, unlinks the master and restricts the diff to the slave's dir, so the test exercises the intended "hardlink source excluded" warning on any filesystem. Verified locally by simulating the FreeBSD inode order (creating
bbeforea): the unfixed test fails withAssertionError: 0 != 1like on FreeBSD, the fixed test passes in both orders.Also drops the FreeBSD/NetBSD skip on this test: its failure was traversal-order dependence, not the kernel ctime quirks of #9147 / #9153 (which concern
test_hard_link_deletion_and_replacement).🤖 Generated with Claude Code