Created attachment 9350 [details]
When running rsync --xattrs --link-dest with --dry-run, a warning is printed if the current directory does not match the source directory. Inspection with strace showed that the current directory is not changed when using --dry-run.
An example message:
rsync: get_xattr_names: llistxattr(""/tmp/test-rsync-bug/2/a/file"",1024) failed: No such file or directory (2)
See attached shell script.
Both symlinks and devices had a bug where the finding of a link-dest item to use caused the itemize info to break when --dry-run was in effect. I changed the code to itemize against the found alt-dest file (as normal files already did), and that fixes this up (fix is in git). Thanks for the handy test script!