-
Notifications
You must be signed in to change notification settings - Fork 133
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
skip_hardlink not generated where expected. Already hardlinked files have "cp_hardlink" generated - even if seen as dupes #545
Comments
AFAIK you need to pass --keep-hardlinked for rmlint to explicitly mark hardlinks as originals. |
In my command I use -S dma to select the hardlink inode to preserve, and this works fine. My "issue" is that having looked any very many rmlint.sh files I have often seen skip_hardlink after the "original" line. This makes absolute sense to me. I had assumed this is generated instead of cp_hardlink when the inode is already identical. If you then run your "final" rmlint.sh on "critical files" in PARANOID mode (as I do since #436) then the cp_hardlink does a cmp all over again even though the inodes are already identical. My suggestion would be to have an extra test in cp_hardlink to compare inode values (in fact in original_check).
In the above, the test they are not the exact same file contains the comment "hardlinks allowed" - interesting... what does it mean? As can be seen, no inode check is made at any point. If not at the "top level" one could at least be placed before the call to check_for_equality. Or more universally in check_for_equality itself (not sure of ripple effects here though) Existing code, check_for_equality:
An inode test could be placed before the cmp command |
Which version of rmlint are you using? The develop branch had some changes last year including 5ffc2a9 that affect the hardlink preprocessing code, maybe one branch works as expected and the other doesn't? |
I have been able to reproduce this on both master and develop. It's a problem with --merge-directories:
edit: btw, the files in your example have do in fact have different inodes, 895822 vs 809730, but their sizes match. |
I have already run rmlint over some directories on a drive.
Now I am running rmlint on the whole drive to see what remains to be linted.
I'm running with "sh:hardlink".
Strangely already hardlinked files (same inode) have "cp_hardlink" instead of "skip_hardlink" generated in rmlint.sh.
cp_hardlink itself does no sanity check (check to see whether inodes already the same) and does a "rm" and "ln" all over again.
For example: These files share the same inode:
I run the command:
This actually reports 69 dupes but correctly notices that these dupes have zero size (because they are hardlinks of each other):
But the generated rmlint.sh file contains:
I'm not sure if this is potentially a source of problems down the line but it does seems strange.
Any ideas why skip_hardlink is not generated?
Or, in fact, why ANY cp_hardlink lines are generated for these 69 files in the first place.
The text was updated successfully, but these errors were encountered: