While using dirvish, I ran into a runaway rsync process, which was
continually spewing errors after encountering a "Too many links"
error.
This was with 2.6.9.
I tried it again with the latest cvs version, and now at least it
doesn't endless-loop with errors, but instead gives an assertion error.
To reproduce:
$ cd /tmp
$ mkdir a b
$ cd a
$ date > a
$ x=1
$ while ln a a$x; do x=$(($x + 1)); done
Let this run until a "Too many links" error is given.
On my reiserfs filesystem this is 64535 links, on ext3 is appears to be
32000.
Now remove some of these links, as it doesn't go wrong if the very first
link fails (rsync then copies the file instead of linking, apparently);
also, it doesn't go wrong if the file list isn't that large:
$ rm a????
$ ln a??? ../b
(removing a??? and linking a?? doesn't demonstrate the effect)
$ cd ..
$ rsync -aHv --link-dest ../b/ a/ c/
...
a18185 => a100
a18186 => a100
rsync: link "/tmp/c/a18187" => a100 failed: Too many links (31)
rsync: link "/tmp/c/a182" => ../b/a182 failed: Too many links (31)
rsync: hlink.c:449: finish_hard_link: Assertion `flist != ((void *)0)'
failed.
rsync: connection unexpectedly closed (65601 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(598)
[sender=3.0.0cvs]
Repeating the rsync command while the 'c' directory is left intact after
the previous run gives a slightly different output:
sending incremental file list
./
rsync: link "/tmp/c/a18187" => a failed: Too many links (31)
rsync: hlink.c:473: finish_hard_link: Assertion `(((unsigned char
*)(node->data))[0]) == 0' failed.
rsync: connection unexpectedly closed (12 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(598)
[sender=3.0.0cvs]
Paul Slootman