#878079 Does not handle target writing errors

Package:
rsync
Source:
rsync
Description:
fast, versatile, remote (and local) file-copying tool
Submitter:
martin f krafft
Date:
2017-10-09 16:12:06 UTC
Severity:
important
#878079#5
Date:
2017-10-09 16:06:27 UTC
From:
To:
If the destination of an rsync transfer is not writeable or runs out of free
space, the transfer does not abort. Instead, even the next file is
happily processed and errors are delayed until the very end:

  % sudo lvcreate -L 512M -n rsynctest albatross_hdd
    Logical volume "rsynctest" created.

  % sudo mkfs.ext4 /dev/albatross_hdd/rsynctest
    […]

  % sudo mount /dev/albatross_hdd/rsynctest /mnt

  % cd /tmp; mkdir rsynctest; cd rsynctest

  % dd if=/dev/urandom of=one bs=1M count=1024
  1024+0 records in
  1024+0 records out
  1073741824 bytes (1,1 GB, 1,0 GiB) copied, 4,48301 s, 240 MB/s

  % ln one two

  % rsync -Pvr /tmp/rsynctest/ /mnt
  sending incremental file list
  one
    1,073,741,824 100%  398.74MB/s    0:00:02 (xfr#1, to-chk=1/3)
  two
    1,073,741,824 100%  333.88MB/s    0:00:03 (xfr#2, to-chk=0/3)
  rsync: mkstemp "/mnt/.one.REoYOa" failed: Permission denied (13)
  rsync: mkstemp "/mnt/.two.t6Pwx8" failed: Permission denied (13)

  sent 2,148,008,118 bytes  received 257 bytes  390,546,977.27 bytes/sec
  total size is 2,147,483,648  speedup is 1.00
  rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]

There, 2G of data transferred pointlessly. Or this:

  % rsync -Pvr /tmp/rsynctest/ /mnt
  sending incremental file list
  one
    1,073,741,824 100%  251.77MB/s    0:00:04 (xfr#1, to-chk=1/3)
  two
    1,073,741,824 100%  328.21MB/s    0:00:03 (xfr#2, to-chk=0/3)
  rsync: write failed on "/mnt/one": No space left on device (28)
  rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.2]

And here, 1G of data transferred pointlessly.

This hasn't exactly caused data loss, but certainly a lot of time
was wasted.