Bogus rsync "Success" message when out of disk space

John Van Essen vanes002 at umn.edu
Thu Nov 7 09:01:19 EST 2002


To the rsync maintainers:

When rsync 2.5.5 is pulling files and the target disk runs out of space,
this is what the tail end of the message stream looks like (w/--verbose):


write failed on games/ghostmaster/ectsdemo2002.zip : Success
rsync error: error in file IO (code 11) at receiver.c(243)
rsync: connection unexpectedly closed (152112 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(150)


"Success", eh?  I don't think so.  :)

In receiver.c there are three places with code similar to:

    if (fd != -1 && write_file(fd,data,i) != i) {
        rprintf(FERROR,"write failed on %s : %s\n",fname,strerror(errno));
        exit_cleanup(RERR_FILEIO);
    }

A partial write due to running out of room (as opposed to a write
that fails to write any data at all) apparently does not set an
error code (errno stays 0).  This is on RedHat 7.2 btw.

So the rprintf lines need to be changed to something like this:

        rprintf(FERROR,"write failed on %s : %s\n",fname,
          strerror(errno ? errno : ENOSPC));


Another small request while I have your attention.

In main.c:

        rprintf(FINFO, RSYNC_NAME "[%d] (%s%s%s) heap statistics:\n",

Could you prepend a newline to the beginning of this so it does not
blend in with the last line of any transfer-related output?

        rprintf(FINFO, RSYNC_NAME "\n[%d] (%s%s%s) heap statistics:\n",

Thanks.
-- 
        John Van Essen  Univ of MN Alumnus  <vanes002 at umn.edu>
        3DGamers  Systems Software Support  <jve at 3dgamers.com>




More information about the rsync mailing list