DO NOT REPLY [Bug 5520] Rsync cannot copy to a vfat partition on Linux kernel 2.6.25+

samba-bugs at samba-bugs at
Sat Jun 14 18:13:07 GMT 2008

wayned at changed:

           What    |Removed                     |Added
             Status|NEW                         |ASSIGNED

------- Comment #1 from wayned at  2008-06-14 13:13 CST -------
I assume that the -EPERM error is at the kernel level, and the application gets
a return of -1 with errno = EPERM.  It would be much better to return errno =
EINVAL so that the error could be easily distinguished from a real EPERM error
where the user doesn't have permission to operate on the file.  Since the
kernel call is complaining about being unable to support the requested
permissions, EINVAL seems like a much more logical error to me.  But let's
leave that aside for now.

I assume it is the fchmod() function that is returning the error (sadly, the
strace in the original bug report did not contain the process that was actually
failing).  If so, you can avoid the mkstemp failure by not asking rsync to
preserve permissions (e.g. --no-p).

So, is the issue that rsync is trying to create a mode 0600 file and the mount
options are set to make the mount world-readable/writable?  I'd be loath to
make rsync retry the fchmod() call with 0666 unless the user asked for that
explicitly.  Or perhaps have an option to just skip the fchmod() on the temp

Any no-option ideas that are safe?  Perhaps test if the new temp file has bits
set outside the umask, and if so, skip the fchmod()?

You might also try changing your mount options to mount the media as a single
user, which I would imagine would make a mode of 0600 acceptable to the kernel.

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