Repository navigation
fix: report receiver hard-link, attribute and deletion-skip errors as upstream does - #8318
Merged
Merged
Conversation
…ream - hard links: every failed link() is a per-file "link %s => %s failed" with exit 23 (hlink.c hard_link_one), and an obstacle at the follower path goes through the shared make-way path (generator.c atomic_create) - receiver set_file_attrs failures use upstream's chown/chgrp/times/ permissions wording through full_fname (rsync.c:685, :784, :815) - "IO error encountered -- skipping file deletion" is a plain FINFO, hidden only by --quiet (generator.c:308, log.c:344-345)
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes three places where the network receiver reports or counts an error differently from rsync 3.5.1. It covers tasks 216, 218 and 251. Every cell was measured against the 3.5.1 tarball build, on both push and pull.
-RH --no-implied-dirs, follower under a regular filedst/sub[generator] link "<dst>/sub/b" => a failed: Not a directory (20)-aH, empty directory where a follower goes-a --inplaceinto a root-owned 0666 file[receiver] chgrp "<dst>/f" failed: Operation not permitted (1)failed to preserve group '<dst>/f': ... (os error 1)--deletewith a sender I/O error,--info=nonreg0IO error encountered -- skipping file deletion-qChanges
Hard links (task 216)
Every failed hard link is now an error for that one file, whatever the errno: it prints
link %s => %s failed, the run goes on, and it ends with exit 23. Before, only EACCES/EPERM were handled per file. Every other errno aborted the transfer.hard_link_one().rsyserr(FERROR_XFER, errno, "link %s => %s failed", full_fname(fname), oldname)is at :486.An existing destination where a follower goes is now cleared the same way as for symlinks and devices:
make_way_for_replacement(..., MakeWayFor::File). An empty directory is removed, a populated one is refused, and anything else is backed up or unlinked. Before, the code tried a silent unlink, and the link then failed with EEXIST and aborted the transfer.maybe_hard_link()atomic_create(..., DEL_FOR_FILE)Receiver attribute failures (task 218)
When the receiver fails to set an attribute on the file it just wrote, the error now uses upstream's wording:
chown|chgrp %s failed,failed to set times on %sorfailed to set permissions on %s. It names the file that was handed toset_file_attrs()(the temp file before the rename) throughfull_fname(). The disk thread formats the line with the same path context as the receiver's other diagnostics;FullFnamePaths::receiveris now shared by the disk-commit config and the pipelined receiver. The exit code was already 23 and does not change.finish_transfer()->set_file_attrs(fnametmp, ...)"%s %s failed"), :784 (times), :815 (permissions)Skipped-deletion notice (task 251)
IO error encountered -- skipping file deletionis now a level-0 info event on the client receiver and in the local copy. No--infosetting hides it; only--quietdoes. Before, it was gated onNONREGlevel 1.delete_in_dir()prints it with a plainrprintf(FINFO, ...), at :308.rwrite()'s FINFO arm returns underquiet.Deviations
cannot delete non-empty directory: b(delete.c:179) andcould not make way for new regular file: b(delete.c:283), then hangs until it is killed. I measured this on push and pull. oc prints the same two lines, skips the follower and ends with exit 23. The deviation is documented at the call site inreceiver/directory/links.rsand pinned bypopulated_directory_in_the_way_of_a_hard_link_is_refused_without_hanging. That cell has no upstream oracle; the CLI runner's wall-time limit is its hang guard.Known limits
atomic_create()links a follower under a temp name and then renames it over an existing destination. oc unlinks first and then links, as it already does for symlinks and devices. So for an existing regular file in an unwritable directory, 3.5.1 reportslink "<dst>/.b.XXXXXX" => ...while oc reportsdelete_file: unlink(b) failed.--deletepush or pull where the sender hits an I/O error, 3.5.1 still deletes the extraneous file in a directory it swept before the error (the INC_RECURSE root sweep). oc keeps it. The new notice test asserts only the notice and the exit code.Tests
tests/receiver_generator_rsyserr.rsgets six new cells:hard_link_under_a_file_parent_is_reported_and_exits_23empty_directory_in_the_way_of_a_hard_link_is_replacedpopulated_directory_in_the_way_of_a_hard_link_is_refused_without_hangingfailed_receiver_set_file_attrs_uses_upstream_wording(sudo-planted root-owned file; skipped as root or withoutsudo -n)io_error_delete_notice_is_a_plain_finfo(push, pull and local, each at default,--info=nonreg0and-q)Direction::Localand arun_outputmethod that also returns stdout.receiver/tests/hard_links.rs:create_hardlinks_surfaces_non_eacces_errorasserted the old abort-on-EEXIST behaviour, and its upstream claim does not match 3.5.1. It is replaced bycreate_hardlinks_replaces_an_empty_directory_obstacleandcreate_hardlinks_reports_a_refused_obstacle_and_continues.engine/.../execute_ignore_errors.rs: the notice filter now matches the level-0Miscevent.Results on the host:
tests/receiver_generator_rsyserr.rs: 8/8 passed.transfer+engine+metadata(filter io_error|delete|hard|link|metadata|full_fname|notice|skip|attrs): 1959/1959 passed.hard_link_under_a_file_parent_is_reported_and_exits_23fails.empty_directory_in_the_way_of_a_hard_link_is_replacedfails.failed_receiver_set_file_attrs_uses_upstream_wordingfails.io_error_delete_notice_is_a_plain_finfofails.cargo fmt --all --check,tools/ci/check_rustfmt_all.py,cargo clippy --workspace --all-targets --all-features -D warningsand the same clippy run forx86_64-pc-windows-gnu: all pass.