Bug 10679 - readlink_stat error results in deletion of mountpoints
Summary: readlink_stat error results in deletion of mountpoints
Status: NEW
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.0
Hardware: Sparc Solaris
: P5 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-27 22:53 UTC by AndyT
Modified: 2014-06-27 22:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AndyT 2014-06-27 22:53:57 UTC
I am trying to rsync Solaris non-global zone from the global running the following command (from a
script):

rsync -aSzx --del --ignore-errors --stats \
--exclude "sc-gis03/root/proc/*" \
--exclude "sc-gis03/root/var/run/*" \
--exclude "sc-gis03/root/system/contract/process/*" \
boi-blade02:/zones/sc-gis03 /zones

where `sc-gis03' is a running Solaris zone to be copied.

The problem I run into is this.  sc-gis03 has two NFS mounts.  The mountpoints are /docrep01 and
/backup01.  From rsync perspective, they appear as:
/zones/sc-gis03/root/docrep01
/zones/sc-gis03/root/backup01

Since the two entries above are mountpoints, rsync does not have access to them, and returns the
following errors:

rsync: readlink_stat("/zones/sc-gis03/root/docrep01") failed: Not owner (1)
rsync: readlink_stat("/zones/sc-gis03/root/backup01") failed: Not owner (1)

This is fine, nothing can be done about it.  What seems to be wrong is that rsync deletes these
directories in the destination, as can be seen from a verbose run:

deleting sc-gis03/root/docrep01/
deleting sc-gis03/root/backup01/

IMHO, if rsync cannot stat a file because it does not have permissions to do so, it should just
leave it alone.  In case you are wondering, my script captures those `readlink_stat' errors, and
creates the directories after rsync exits, so next time the whole cycle is repeated.

Environment:

# uname -a
SunOS plt-blade06 5.10 Generic_144488-12 sun4v sparc SUNW,Sun-Blade-T6320
#  # rsync --version
rsync  version 3.1.0  protocol version 31
Copyright (C) 1996-2013 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, no symtimes, no prealloc