Write failures and proper error code return to clients

Shlomi Yaakobovich Shlomi at exanet.com
Sat Jul 22 03:53:30 GMT 2006


Hi,
 
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) {
SCVAL(outbuf,smb_rcls,ERRHRD);
SSVAL(outbuf,smb_err,ERRdiskfull);      
}

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.
Thanks,
Shlomi
 


More information about the samba-technical mailing list