Bug 10568 - --copy-links Fails if link name has more than 32 chars
--copy-links Fails if link name has more than 32 chars
Status: RESOLVED INVALID
Product: rsync
Classification: Unclassified
Component: core
3.0.4
All Linux
: P5 critical
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-26 16:24 UTC by David Levy
Modified: 2014-05-26 21:57 UTC (History)
1 user (show)

See Also:


Attachments
strace output when running rsync -L (198.75 KB, application/octet-stream)
2014-04-26 16:24 UTC, David Levy
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Levy 2014-04-26 16:24:02 UTC
Created attachment 9879 [details]
strace output when running rsync -L

Having a link with a name exceeding 32 characters fails to transform symlink into referent file/dir.

Example of links which fail to convert to referent files:

armedia@vmelr01:/ardome/media/kf/kf1/2014/03/25/1100140325029584406/ardok-index> l
total 1024
drwxr-xr-x 2 armedia ardome 2141 Apr 26 13:16 ./
drwxr-xr-x 3 armedia ardome 2054 Apr 26 00:16 ../
lrwxrwxrwx 1 armedia ardome   91 Apr 26 12:14 0830348-PULSERASROJASCAP1-Y.data -> /ARDOMEMOUNTS/media/kf//kf0/2014/03/25/1100140325029584406/0830348-PULSERASROJASCAP1-Y.data
lrwxrwxrwx 1 armedia ardome   92 Apr 26 13:16 0830348-PULSERASROJASCAP1-Y.index -> /ARDOMEMOUNTS/media/kf//kf0/2014/03/25/1100140325029584406/0830348-PULSERASROJASCAP1-Y.index


RESULT:
armedia@vmelr01:/ardome/media/kf/kf1/2014/03/25/1100140325029584406/ardok-index> l
total 3584
drwxr-xr-x 2 armedia ardome    2147 Apr 26 13:17 ./
drwxr-xr-x 3 armedia ardome    2054 Apr 26 00:16 ../
lrwxrwxrwx 1 armedia ardome      91 Apr 26 12:14 0830348-PULSERASROJASCAP1-Y.data -> /ARDOMEMOUNTS/media/kf//kf0/2014/03/25/1100140325029584406/0830348-PULSERASROJASCAP1-Y.data
-rw-r--r-- 1 armedia ardome 2504142 Apr 26 13:17 0830348-PULSERASROJASCAP1-Y.index


File exceeding 32 chars gets transformed into file with less than 32 chars, check file sizes.
in example:
- 0830348-PULSERASROJASCAP1-Y.index has been transformed to wrong file 0830348-PULSERASROJASCAP1-Y.data instead.

Original files being linked size
armedia@vmelr01:/ardome/media/kf/kf1/2014/03/25/1100140325029584406/ardok-index> l /ARDOMEMOUNTS/media/kf//kf0/2014/03/25/1100140325029584406/
total 3040
drwxrwxrwx   2 armedia ardome    8192 Mar 25 03:49 ./
drwxrwxrwx 304 armedia ardome   24576 Mar 25 23:56 ../
-rw-rw-rw-   1 armedia ardome 2504142 Mar 25 04:34 0830348-PULSERASROJASCAP1-Y.data
-rw-rw-rw-   1 armedia ardome  566792 Apr  7 16:04 0830348-PULSERASROJASCAP1-Y.index  


STRACE ATTCHED.
Comment 1 Wayne Davison 2014-05-26 21:18:46 UTC
The command you ran was a copy of rsync -L 0830348-PULSERASROJASCAP1-Y.data 0830348-PULSERASROJASCAP1-Y.index, so you told it to copy the contents of the data file onto the index filename (replacing the symlink) which is what it did.
Comment 2 David Levy 2014-05-26 21:35:15 UTC
Running
rsync -L

Should convert each link in directory to it's referent file, when the filename exceeds 32 chars that fails. This is easy to test, don't just resolve cause that fails.

Let me know if you have different results.


(In reply to comment #1)
> The command you ran was a copy of rsync -L 0830348-PULSERASROJASCAP1-Y.data
> 0830348-PULSERASROJASCAP1-Y.index, so you told it to copy the contents of the
> data file onto the index filename (replacing the symlink) which is what it did.
Comment 3 Wayne Davison 2014-05-26 21:57:53 UTC
If you were expecting the destination symlink to be followed, that is not how rsync works.  The -L option just affects source symlinks, and the -K option just affects destination symlinks to directories.