DO NOT REPLY [Bug 3692] New: regression: symlinks are created as hardlinks with --link-dest

samba-bugs at samba.org samba-bugs at samba.org
Mon Apr 17 05:41:21 GMT 2006


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

           Summary: regression: symlinks are created as hardlinks with --
                    link-dest
           Product: rsync
           Version: 2.6.7
          Platform: x86
               URL: http://rsync.samba.org
        OS/Version: FreeBSD
            Status: NEW
          Severity: major
          Priority: P3
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: noreply at cpe-24-95-90-2.columbus.res.rr.com
         QAContact: rsync-qa at samba.org


hi. this refers to the official 2.6.7 release, no mods.
was working on verifying some older bugs and this one popped
up as new, it used to work ok. wanted to get it posted though
i've no patch. will gladly test any submitted.

regression: symlinks are created as hardlinks with --link-dest
the first run creates them erroneously as hardlinks.
a single repeat of the same command 'fixes' the mistake of the
first and should not be necessary.
the nth repeat of the same command does nothing because it's
now in sync.

by verbose example...


## show the current state of things
[] ls -aliT 0 1 2 3 4
ls: 1: No such file or directory
ls: 2: No such file or directory
ls: 3: No such file or directory
ls: 4: No such file or directory
0:
550260 drwxr-x---  2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x  5 moo moo       512 Apr 17 00:46:06 2006 ..
550261 prw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550262 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550262 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  2 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  2 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----  1 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  2 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  2 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----  1 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  2 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  2 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550267 srw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 socket0
550268 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550268 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----  1 moo moo         0 Apr 16 21:47:16 2006 source0
550269 lrwxr-x---  1 moo moo         7 Apr 16 21:57:12 2006 target1 -> source0


## ok, now copy 0 to 1 using 0 as a reference...
#  the use of 0 as a reference when initializing the
#  first copy is valid though perhaps confusing. it also
#  happens to make writing backup scripts easier by
#  eliminating some initialization logic.
[] rsync -Haxv --delete --link-dest=`pwd`/0/ ./0/ ./1/
created directory ./1
./
fifo0
fifohard2
fifohard1 => fifohard2
socket0
sockethard2
sockethard1 => sockethard2

# ...hey where'd that hardlink come from and where's my symlink?
#  perhaps using link() instead of symlink().
[] ls -aliT 1
550259 drwxr-x---  2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x  6 moo moo       512 Apr 17 00:47:08 2006 ..
550272 prw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550274 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550274 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----  2 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  4 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  4 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----  2 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  4 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  4 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----  2 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  4 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  4 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550275 srw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 socket0
550276 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550276 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----  3 moo moo         0 Apr 16 21:47:16 2006 source0
550273 -rw-r-----  3 moo moo         0 Apr 16 21:47:16 2006 target1

# lets see what happens if it's run again...
[] rsync -Haxv --delete --link-dest=`pwd`/0/ ./0/ ./1/
target1 -> source0

# ...the second run seems to have fixed the problem...
[] ls -aliT 1
550259 drwxr-x---  2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x  6 moo moo       512 Apr 17 00:47:08 2006 ..
550272 prw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550274 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550274 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----  2 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  4 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  4 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----  2 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  4 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  4 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----  2 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  4 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  4 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550275 srw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 socket0
550276 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550276 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----  2 moo moo         0 Apr 16 21:47:16 2006 source0
550277 lrwxr-x---  1 moo moo         7 Apr 16 21:57:12 2006 target1 -> source0

# ...for sure? yes.
[] rsync -Haxv --delete --link-dest=`pwd`/0/ ./0/ ./1/
<nothing>


## ok, so lets try an incremented referential copy...
[] rsync -Haxv --delete --link-dest=`pwd`/1/ ./0/ ./2/
created directory ./2
./
fifo0
fifohard2
fifohard1 => fifohard2
socket0
sockethard2
sockethard1 => sockethard2

# ...same problem.
[] ls -aliT 2
550278 drwxr-x---  2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x  7 moo moo       512 Apr 17 00:49:37 2006 ..
550279 prw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550280 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550280 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----  3 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  6 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  6 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----  3 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  6 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  6 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----  3 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  6 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  6 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550281 srw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 socket0
550282 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550282 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----  4 moo moo         0 Apr 16 21:47:16 2006 source0
550273 -rw-r-----  4 moo moo         0 Apr 16 21:47:16 2006 target1

# running the same thing again...
[] rsync -Haxv --delete --link-dest=`pwd`/1/ ./0/ ./2/
target1 -> source0

# ...fixes it.
[] ls -aliT 2
550278 drwxr-x---  2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x  7 moo moo       512 Apr 17 00:49:37 2006 ..
550279 prw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550280 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550280 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----  3 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  6 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  6 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----  3 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  6 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  6 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----  3 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  6 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  6 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550281 srw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 socket0
550282 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550282 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----  3 moo moo         0 Apr 16 21:47:16 2006 source0
550283 lrwxr-x---  1 moo moo         7 Apr 16 21:57:12 2006 target1 -> source0


## so try the remaining permutation by using a broken reference
# to create a new copy.

# create the broken reference 3....
[] rsync -Haxv --delete --link-dest=`pwd`/2/ ./0/ ./3/
created directory ./3
./
fifo0
fifohard2
fifohard1 => fifohard2
socket0
sockethard2
sockethard1 => sockethard2

# ...broken as expected.
[] ls -aliT 3
550284 drwxr-x---  2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x  8 moo moo       512 Apr 17 00:52:41 2006 ..
550285 prw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550286 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550286 prw-rw----  2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----  4 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  8 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  8 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----  4 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  8 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  8 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----  4 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  8 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  8 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550287 srw-rw----  1 moo moo         0 Aug  9 02:01:36 2005 socket0
550288 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550288 srw-rw----  2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----  5 moo moo         0 Apr 16 21:47:16 2006 source0
550273 -rw-r-----  5 moo moo         0 Apr 16 21:47:16 2006 target1

# now use it to make copy 4...
[] rsync -Haxv --delete --link-dest=`pwd`/3/ ./0/ ./4/
created directory ./4
./
fifo0
fifohard2
fifohard1 => fifohard2
socket0
sockethard2
sockethard1 => sockethard2
target1 -> source0

# ...which turns out to be correct, at least in meaning of 4 is the same as 0.
[] ls -aliT 4
550289 drwxr-x---   2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x   9 moo moo       512 Apr 17 00:53:20 2006 ..
550290 prw-rw----   1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550291 prw-rw----   2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550291 prw-rw----   2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----   5 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  10 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  10 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----   5 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  10 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  10 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----   5 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  10 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  10 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550292 srw-rw----   1 moo moo         0 Aug  9 02:01:36 2005 socket0
550293 srw-rw----   2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550293 srw-rw----   2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----   6 moo moo         0 Apr 16 21:47:16 2006 source0
550294 lrwxr-x---   1 moo moo         7 Apr 16 21:57:12 2006 target1 -> source0

# so try the same command again...
[] rsync -Haxv --delete --link-dest=`pwd`/3/ ./0/ ./4/
<nothing>

# ...looks ok.
[] ls -aliT 4
550289 drwxr-x---   2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x   9 moo moo       512 Apr 17 00:53:20 2006 ..
550290 prw-rw----   1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550291 prw-rw----   2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550291 prw-rw----   2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----   5 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  10 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  10 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----   5 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  10 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  10 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----   5 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  10 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  10 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550292 srw-rw----   1 moo moo         0 Aug  9 02:01:36 2005 socket0
550293 srw-rw----   2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550293 srw-rw----   2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----   6 moo moo         0 Apr 16 21:47:16 2006 source0
550294 lrwxr-x---   1 moo moo         7 Apr 16 21:57:12 2006 target1 -> source0

# and lets use a good reference for kicks...
[] rsync -Haxv --delete --link-dest=`pwd`/2/ ./0/ ./4/
<nothing>

# ...seems fine.
[] ls -aliT 4
550289 drwxr-x---   2 moo moo       512 Apr 16 22:35:34 2006 .
415920 drwxr-xr-x   9 moo moo       512 Apr 17 00:53:20 2006 ..
550290 prw-rw----   1 moo moo         0 Aug  9 02:01:36 2005 fifo0
550291 prw-rw----   2 moo moo         0 Aug  2 00:47:06 2005 fifohard1
550291 prw-rw----   2 moo moo         0 Aug  2 00:47:06 2005 fifohard2
550270 -rw-rw----   5 moo moo         0 Aug  9 02:01:36 2005 file0
550271 -rw-rw----  10 moo moo         0 Jul 31 22:58:45 2005 filehard1
550271 -rw-rw----  10 moo moo         0 Jul 31 22:58:45 2005 filehard2
550263 brw-rw----   5 moo moo    2,   2 Aug  9 02:01:36 2005 nullb0
550264 brw-rw----  10 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard1
550264 brw-rw----  10 moo moo    2,   2 Aug  4 01:48:48 2005 nullbhard2
550265 crw-rw----   5 moo moo    2,   2 Aug  9 02:01:36 2005 nullc0
550266 crw-rw----  10 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard1
550266 crw-rw----  10 moo moo    2,   2 Aug  4 01:50:01 2005 nullchard2
550292 srw-rw----   1 moo moo         0 Aug  9 02:01:36 2005 socket0
550293 srw-rw----   2 moo moo         0 Aug  4 02:05:00 2005 sockethard1
550293 srw-rw----   2 moo moo         0 Aug  4 02:05:00 2005 sockethard2
550273 -rw-r-----   6 moo moo         0 Apr 16 21:47:16 2006 source0
550294 lrwxr-x---   1 moo moo         7 Apr 16 21:57:12 2006 target1 -> source0


# end of bug, well, the report anyways.


-- 
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