DO NOT REPLY [Bug 3693] rsync can use same --link-dest file several times, leading to incorrect hard links

samba-bugs at samba.org samba-bugs at samba.org
Tue Apr 18 02:20:20 GMT 2006


https://bugzilla.samba.org/show_bug.cgi?id=3693





------- Comment #3 from noreply at cpe-24-95-90-2.columbus.res.rr.com  2006-04-17 21:20 MST -------
> "If DIR is a relative path, it is relative to the destination directory."

apologies indeed, missed that in the man page.

> Please try my corrected script and see if the rest of your remarks still
> apply.

yep, that that looks like a bug now. seems that dest/{f1,f2} should each get
their own unique inums as they are unique in the src and linkdest is just
a stale image of src. i used the cvs HEAD to test.

maybe rsync is seeing that src/{f1,f2} still have everything _but_ the inode
relationship in linkdest the same, assumes that's enough and links the
dest versions back to linkdest. -H would imply to check that too.

> ...

still not sure of the description of the proposed solution. seems that some
rather crazy hardlink counts would be out there in the wild but that as long
as the structures that hold the pictures for src, linkdest and dest are the
same, except for the inums between them and old non-matching gunk in linkdest,
it'd be cool. but hey, you're probably right, some of us people just have
brain drain from filing taxes ;-]


part 2...
and running a plain one does not fix them once broken either, yikes.
figured until fixed i could just run this over top of it and be done.
# /tmp/rsync -Haxv --delete ./src/ ./dest/
# find src linkdest dest -ls
550518    4 drwxr-xr-x    2 root     wheel   512 Apr 17 21:02 src
550488    0 -rw-r--r--    1 root     wheel     0 Apr 17 21:02 src/f1
550512    0 -rw-r--r--    1 root     wheel     0 Apr 17 21:02 src/f2
550482    4 drwxr-xr-x    2 root     wheel   512 Apr 17 21:02 linkdest
550264    0 -rw-r--r--    4 root     wheel     0 Apr 17 21:02 linkdest/f1
550264    0 -rw-r--r--    4 root     wheel     0 Apr 17 21:02 linkdest/f2
569089    4 drwxr-xr-x    2 root     wheel   512 Apr 17 21:02 dest
550264    0 -rw-r--r--    4 root     wheel     0 Apr 17 21:02 dest/f1
550264    0 -rw-r--r--    4 root     wheel     0 Apr 17 21:02 dest/f2

if you blow away dest and do a plain -Ha copy it works as expected.
i'd rather have an accurate copy over free cpu/ram if that matters.

doesn't look to be new as it's present in:
 rsync267
 rsync20050802
 rsync264pre2
 rsync263

cheers all.


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the rsync mailing list