Skip to content

tests: fix inode-order dependence in test_multiple_link_exclusion, fixes #8740 - #10152

Merged
ThomasWaldmann merged 1 commit into
borgbackup:1.4-maintfrom
ThomasWaldmann:diff-hardlink-8740
Aug 18, 2026
Merged

tests: fix inode-order dependence in test_multiple_link_exclusion, fixes #8740#10152
ThomasWaldmann merged 1 commit into
borgbackup:1.4-maintfrom
ThomasWaldmann:diff-hardlink-8740

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Fixes #8740.

borg 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 directories over cylinder groups, so b may get a lower inode than a — then b/hardlink became the master (with chunks) and diff restricted to input/b compared 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 b before a): the unfixed test fails with AssertionError: 0 != 1 like 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

 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

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.11%. Comparing base (1b7d327) to head (17412cf).
⚠️ Report is 29 commits behind head on 1.4-maint.

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.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann
ThomasWaldmann merged commit 2eccded into borgbackup:1.4-maint Aug 18, 2026
12 of 14 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the diff-hardlink-8740 branch August 18, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant