Bug 110299 - trailing slash alters time behavior deep in tree
trailing slash alters time behavior deep in tree
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rsync (Show other bugs)
1
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Jay Fenlason
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-17 20:47 EST by Joe Harrington
Modified: 2014-08-31 19:25 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-11-17 21:56:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joe Harrington 2003-11-17 20:47:11 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020913

Description of problem:
The presence of trailing slashes on command-line directory names
alters the results of the time comparison test for files in those
directories, recursively.  With trailing slashes, the results are as
expected: a file is copied only when it is different between the
trees.  Without trailing slashes, it is copied (or at least listed as
copied) regardless.

Version-Release number of selected component (if applicable):
rsync-2.5.6-19

How reproducible:
Always

Steps to Reproduce:
mkdir bar baz
cp -p /boot/vmlinux-2.4.22-1.2115.nptl bar
cp -p /boot/vmlinux-2.4.22-1.2115.nptl baz
rsync -avvn bar baz


Actual Results:  It lists bar/vmlinuz... as to be copied

building file list ... 
expand file_list to 4000 bytes, did move
done
delta-transmission disabled for local transfer or --whole-file
bar/vmlinux-2.4.22-1.2115.nptl
total: matches=0  tag_hits=0  false_alarms=0 data=0
wrote 88 bytes  read 24 bytes  224.00 bytes/sec
total size is 2843240  speedup is 25386.07


Expected Results:  It should not list it as to be copied, as in this
example with trailing slashes:

rsync -avvn bar/ baz/
building file list ... 
expand file_list to 4000 bytes, did move
done
delta-transmission disabled for local transfer or --whole-file
total: matches=0  tag_hits=0  false_alarms=0 data=0
wrote 80 bytes  read 20 bytes  200.00 bytes/sec
total size is 2843240  speedup is 28432.40


Additional info:

Reversing the order of bar and baz has no effect on the result. 
Adding --modify-window=200 has no effect on the result either.

Doing an actual rsync changes something that is not visible to stat
and that makes the problem go away for the particular pair of files:

/root/t# mkdir bar baz
/root/t# cp -p /boot/vmlinux-2.4.22-1.2115.nptl bar
/root/t# cp -p /boot/vmlinux-2.4.22-1.2115.nptl baz
/root/t# stat */vmlinux*
  File: `bar/vmlinux-2.4.22-1.2115.nptl'
  Size: 2843240   	Blocks: 5568       IO Block: 4096   regular file
Device: 305h/773d	Inode: 1101267     Links: 1    
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2003-11-17 20:38:50.000000000 -0500
Modify: 2003-10-29 15:39:47.000000000 -0500
Change: 2003-11-17 20:41:38.000000000 -0500

  File: `baz/vmlinux-2.4.22-1.2115.nptl'
  Size: 2843240   	Blocks: 5568       IO Block: 4096   regular file
Device: 305h/773d	Inode: 575466      Links: 1    
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2003-11-17 20:41:38.000000000 -0500
Modify: 2003-10-29 15:39:47.000000000 -0500
Change: 2003-11-17 20:41:38.000000000 -0500

/root/t# rsync -avvn baz bar
building file list ... 
expand file_list to 4000 bytes, did move
done
delta-transmission disabled for local transfer or --whole-file
baz/vmlinux-2.4.22-1.2115.nptl
total: matches=0  tag_hits=0  false_alarms=0 data=0
wrote 88 bytes  read 24 bytes  224.00 bytes/sec
total size is 2843240  speedup is 25386.07
/root/t# rsync -avv baz bar
building file list ... 
expand file_list to 4000 bytes, did move
done
delta-transmission disabled for local transfer or --whole-file
baz/vmlinux-2.4.22-1.2115.nptl
total: matches=0  tag_hits=0  false_alarms=0 data=2843240
wrote 2843708 bytes  read 36 bytes  5687488.00 bytes/sec
total size is 2843240  speedup is 1.00
/root/t# rsync -avv baz bar
building file list ... 
expand file_list to 4000 bytes, did move
done
delta-transmission disabled for local transfer or --whole-file
baz/vmlinux-2.4.22-1.2115.nptl is uptodate
total: matches=0  tag_hits=0  false_alarms=0 data=0
wrote 84 bytes  read 20 bytes  208.00 bytes/sec
total size is 2843240  speedup is 27338.85
/root/t# stat */vmlinux*
  File: `bar/vmlinux-2.4.22-1.2115.nptl'
  Size: 2843240   	Blocks: 5568       IO Block: 4096   regular file
Device: 305h/773d	Inode: 1101267     Links: 1    
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2003-11-17 20:38:50.000000000 -0500
Modify: 2003-10-29 15:39:47.000000000 -0500
Change: 2003-11-17 20:41:38.000000000 -0500

  File: `baz/vmlinux-2.4.22-1.2115.nptl'
  Size: 2843240   	Blocks: 5568       IO Block: 4096   regular file
Device: 305h/773d	Inode: 575466      Links: 1    
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2003-11-17 20:41:38.000000000 -0500
Modify: 2003-10-29 15:39:47.000000000 -0500
Change: 2003-11-17 20:41:38.000000000 -0500

I have no idea what could be being changed here, since it's not the
times or the file size, and that's what rsync says it looks at.

The problem exists as far back as rsync-2.4.6-13, from RH 7.2.


--jh--
Comment 1 Joe Harrington 2003-11-17 21:56:51 EST
*ouch*  well, that's embarrassing.

If I'd used ls instead of stat, I would have seen the first directory
copied into the second, as rsync's obscure-but-functional definition of
trailing-slash behavior requires.

Sorry to bother you.

--jh--

Note You need to log in before you can comment on or make changes to this bug.