Write failures and proper error code return to clients

Shlomi Yaakobovich Shlomi at exanet.com
Sat Jul 22 17:47:59 GMT 2006


I still don't know what is the exact errno (current samba code does not have any relevant debug for this). My next step is to print this out, but the problem is quite rare. Copying a batch of 40GB of data (in several directories and files) increases the chances of reproducing it.
 
It might be a coincidence, but while this error happened, there was a suspicious kernel message in the log:
2006 Jul 21 21:59:57 node1 NOTICE: kernel: RPC: sendmsg returned error 105
2006 Jul 21 21:59:57 node1 WARNING: kernel: nfs: RPC call returned error 105

Oh, and our NFS mounts are hard...
 
I will attempt to reproduce, this time with some added information.
 
Thanks,
Shlomi

________________________________

From: Jeremy Allison [mailto:jra at samba.org]
Sent: Sat 7/22/2006 6:47 PM
To: Shlomi Yaakobovich
Cc: samba-technical at samba.org
Subject: Re: Write failures and proper error code return to clients



On Sat, Jul 22, 2006 at 09:21:43AM +0300, Shlomi Yaakobovich wrote:
> 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:

Why does the pwrite system call fail ?

>  if (nwritten < (ssize_t)numtowrite) {
> SCVAL(outbuf,smb_rcls,ERRHRD);
> SSVAL(outbuf,smb_err,ERRdiskfull);     

We should be more intelligent here, I'll look at it for
3.0.24.

> 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.

You can't get EINTR on a write call on a disk system. Well you
can but only if you're writing to NFS on a soft mount, and that
breaks so many things it's not a good idea.

> Another thing worth mentioning is that we are writing to an NFS mount.

Ah - I see. Soft mounts ?

Jeremy




More information about the samba-technical mailing list