You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
create: recursion roots that are hard links of an earlier root are silently not archived #10388
borg create silently drops recursion roots that are hard links of an earlier root. The paths are missing from the archive, rc is 0, there is no warning.
mkdir input; echo -n 123456 > input/file1; ln input/file1 input/file2; ln input/file1 input/file3
borg repo-create -e aes256-ocb
borg create --list arch input/file1 input/file2 input/file3
A input/file1
borg list arch # only input/file1
The same happens in a second form, while recursing: a file root given before its parent directory hides the file's other hard links.
borg create --list arch input/file1 input
A input/file1
d input # input/file2 and input/file3 are missing
And in a third form since symlink roots are followed (#4737): for borg create arch input/link input/target with link -> target and target being a file, only input/link is archived, input/target is dropped.
Cause
create_cmd.py: after _rec_walk() returns for a root, the root's (st_ino, st_dev) is added to skip_inodes (806dc50, "do not recurse into duplicate roots, fixes #5603"), and _rec_walk() returns early for every fs object whose (st_ino, st_dev) is in that set.
That identifies "the same root given twice" correctly for directories, but not for other fs objects: hard links are different paths with the same (st_ino, st_dev), so they are taken for duplicates of the first root.
1.4-maint has the same code in archiver.py (checked by reading the code only, not by running it).
Expected
All paths are archived as one hard link group (same hlid), like they are when the parent directory is the only root. The #5603 protection stays: the same root given twice is archived once.
Activity