[Samba] NFS quotas: truncated files without warning

Jeremy Allison jra at samba.org
Fri Jun 15 17:48:58 GMT 2007


On Fri, Jun 15, 2007 at 07:44:22PM +0200, SER.RI-TIC - David Losada wrote:
> Hi Jeremy,
> 
> thank you for the tip. Unfortunately, this hasn't proved succesful.. how
> I tested it:
> 
> from W2K, as an user with a completely full quota, I drop a 11788 byte
> file into the share. It produces the following system calls in the server:
> 
> write(25, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
> 4096) = 4096
> write(25, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
> 4096) = 4096
> write(25, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
> 3596) = 3596
> 
> (4096+4096+3596 = 11788)
> 
> so my Samba is verifying the availability of storage space through the
> write() system call, which doesn't generate NFS quota errors, ugh. The
> thing is that an fsync() after these write() calls would probably get me
> the NFS quota error... maybe it's implemented this way in a newer Samba
> release?

Yes, that's what we do (I wrote the code :-). I'll add code to
force an fsync after these writes if "strict sync" is also set.

I'll post the patch for 3.0.25 once I've done it.

Can you not run Samba on the NFS server - that would be the best
way to fix this (and avoid double-copies over the network).

Jeremy.


More information about the samba mailing list