Write failures and proper error code return to clients

Shlomi Yaakobovich Shlomi at exanet.com
Sat Jul 22 06:21:43 GMT 2006

We've recently ran into situations when the pwrite system call fails. I've noticed that on -1 return code, a "disk full" error is returned to the user. For example, in reply_write_and_X:
 if (nwritten < (ssize_t)numtowrite) {

I saw no attempt to look at the exact errno, and attempt to return a more valid error code. Furthermore, perhaps it is worth while thinking of retrying the call (e.g. if errno is EINTR) instead of returning an error to the client ?  We've noted that some applications don't behave well to "disk full" error, and abort their operations.
Another thing worth mentioning is that we are writing to an NFS mount. 
Any input would be appreciated.

More information about the samba-technical mailing list