The Samba-Bugzilla – Bug 10081
Multiple rsync instances conflict
Last modified: 2015-02-11 10:48:03 UTC
When running multiple instances of rsync with "--backup" option on same file (for example in case of intersecting include-files), few of them can exit with exitcode "23".
It happens due to nonatomicity of robust_unlink()&do_open() operation in copy_file(). While one of instances is proceeding between robust_unlink() and do_open(), another instance can run do_open(). So the first instance will fail on do_open() due to flag "O_EXCL".
I suggest to remove the flag "O_EXCL" if copy_file() is called from make_backup() function.
Overwriting of "backuped" file is fine behavior, so why not to permit it even for this special case?
I can write a patch. Is this required? I can make my modification to be optional, if this required.
I assume this is not being considered, because the backup needs to be restored in case the new file is corrupted? So overwriting it would be bad?