Skip to content

file_scan: skip hardlinks in --fdupes instead of aborting (#389) - #412

Open
martinus wants to merge 1 commit into
markfasheh:masterfrom
martinus:backport/fdupes-hardlink
Open

file_scan: skip hardlinks in --fdupes instead of aborting (#389)#412
martinus wants to merge 1 commit into
markfasheh:masterfrom
martinus:backport/fdupes-hardlink

Conversation

@martinus

Copy link
Copy Markdown

What this fixes

Filerecs are keyed by inode. Two hard links to the same inode in a single --fdupes group produce the same key and trip the "should never happen" abort in insert_filerec().

What happens without the fix

duperemove --fdupes core-dumps the entire run when the input list contains two or more hard links to the same file.

The fix

Hard links already share storage, so deduping them is pointless anyway — skip any inode already listed. The regular scan path already has an equivalent guard; --fdupes simply lacked one.

Fixes: #389

…#389)

Filerecs are keyed by inode. Two hard links in the same --fdupes group
produced the same key and tripped the "should never happen" abort in
insert_filerec(), core-dumping the whole run. Hard links already share
storage, so skip any inode already listed instead. The regular scan path
has an equivalent guard; --fdupes lacked one.

Fixes: markfasheh#389
Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.

Crash when running duperemove --fdupes on a list containing hard links

1 participant