dear rsyncists, rsync is superb! but did i actually find a bug? i did: $ rsync -vRHSPa rsync://rsync.mirror.ac.uk/updates.redhat.com/7.3/en/os/SRPMS . into an empty local directory the result was 140 bogus hardlinks of the same file: -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 Canna-3.5b2-62.7.3.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 LPRng-3.8.9-4.1.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 WindowMaker-0.80.0-9.3.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 XFree86-4.2.1-13.73.3.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 XFree86-4.2.1-13.73.23.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 apache-1.3.27-3.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 arts-1.0.5a-0.73.0.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 balsa-1.2.4-7.7.3.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 bind-9.2.1-1.7x.2.src.rpm -rw-rw-r-- 140 g g 6147582 2002/12/04 16:55:24 cups-1.1.14-15.4.src.rpm ... i repeated the command without the "H" and it was hunky dory. $ rpm -q rsync rsync-2.5.5-4 $ rsync --version rsync version 2.5.5 protocol version 26 Copyright (C) 1996-2002 by Andrew Tridgell and others <http://rsync.samba.org/> Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, IPv6, 64-bit system inums, 64-bit internal inums redhat 9 with all up2dates. thank you, g
On Sat, 29 Nov 2003, g <gmott@ntlworld.com>?wrote:> >?i did: >?$ ?rsync -vRHSPa rsync://rsync.mirror.ac.uk/updates.redhat.com/7.3/en/os/SRPMS . >?into an empty local directory >? >?the result was 140 bogus hardlinks of the same file:[ snip ]>? >?i repeated the command without the "H" and it was hunky dory. >? >?$ rpm -q rsync >?rsync-2.5.5-4This happens with 2.5.6, too. I added this print statement in recv_file_list(): if (verbose > 2) rprintf(FINFO, "dev:inode = %lld:%lld\n", (long long int) flist->files[i]->dev, (long long int) flist->files[i]->inode ); Without -H, the dev and inode are zero. But with -H, they are all: dev:inode = 0:100 so that explains the hardlinking. How does rsync know whether or not the other side can send dev:inode information? In flist.c, it's controlled by #if's at compile-time: #if SUPPORT_HARD_LINKS if (preserve_hard_links && S_ISREG(file->mode)) { if (remote_version < 26) { /* 32-bit dev_t and ino_t */ write_int(f, (int) file->dev); write_int(f, (int) file->inode); } else { /* 64-bit dev_t and ino_t */ write_longint(f, file->dev); write_longint(f, file->inode); } } #endif What happens if the sender, for whatever reason, has no hard link support compiled in? What will the receiver be reading? -- John Van Essen Univ of MN Alumnus <vanes002@umn.edu>