DO NOT REPLY [Bug 4979] New: readdir() failure results in remote deletes

samba-bugs at samba-bugs at
Tue Sep 18 03:45:41 GMT 2007

           Summary: readdir() failure results in remote deletes
           Product: rsync
           Version: 3.0.0
          Platform: PPC
        OS/Version: Mac OS X
            Status: NEW
          Severity: major
          Priority: P3
         Component: core
        AssignedTo: wayned at
        ReportedBy: joe07734 at
         QAContact: rsync-qa at

I'm using rsync 3.0 to duplicate one hard drive to another. Today the source
drive failed, but in a way that left it appearing to be online and partially
functional. When I attempted to use rsync it reported:

rsync: readdir("/Volumes/KidD/."): Input/output error (5)

And then proceeded to delete every file and directory on the remote volume. It
appears that rsync is not handling this error properly, and that it's treating
it as an empty directory.

The problem is in send_directory() in flist.c. opendir() apparently worked on
my bad volume but readdir() failed. I don't grok the code well enough to
suggest a patch, but I see that errno gets reported at the bottom of the
function but it doesn't short-circuit the remainder of the code, in the way the
error handling on opendir() does earlier in the routine. Is send_if_directory()
still getting called? Does this look like an empty directory to the remote

rsync built with cvs root a week or two ago.

rsync command:
sudo ./rsync --rsync-path=/alias/upkeep/rsync --verbose --archive --xattrs
--delete --stats /Volumes/KidD/ /Volumes/KidD_b/

Configure bugmail:
------- 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