NT_STATUS_DISK_FULL in response to SMB_COM_CLOSE

Mathijs Brands mathijs at brands.name
Tue Mar 9 10:24:04 MST 2010


Hello,

I'll get right to the point: is ERRdiskfull/NT_STATUS_DISK_FULL valid
in a Close response?

Some additional info:

We have a RHEL 5.2 server (Samba 3.0.28) which allows users to access
their UNIX homedir from Windows. The data itself is stored on a NetApp
and mounted by AutoFS.

When a user reaches his (block) quota on the NetApp, Samba returns
NT_STATUS_DISK_FULL. This happens either in a SMB_COM_CLOSE or
SMB_COM_WRITE_ANDX response.

SMB_COM_CLOSED returns NT_STATUS_DISK_FULL if the close() call returns
EDQUOT. SMB_COM_WRITE_ANDX returns NT_STATUS_DISK_FULL a the pwrite()
call returns EDQUOT. Which one occurs seems to depend on timing.

If the write returns NT_STATUS_DISK_FULL, Explorer pops up a warning
that the copy failed and it deletes the file. The user knows it went
wrong and can take action to rectify the situation, such as deleting
some files.

If the close returns the write, Explorer seems blissfully unaware of
the fact the file could not be written completely and it does not
inform the user of this failure, nor does it remove the file. The user
now has a file of the right size and with the right date/time, but
without the correct contents. For the user this will show up as 'data
corruption' (blocks that were not written are read back as all-zeroes).

Our current work-around is to enable 'strict allocate', but this causes
twice as much writes to the NetApp. Samba use ftruncate to get a sparse
file of the right size and then uses write() calls with 4k data to fill
the file.

If I look at Microsofts CIFS specification (http://msdn.microsoft.com/en-us/library/ee442092%28PROT.13%29.aspx),
it lists a list of potential errors in a Close response (page 95).
NT_STATUS_DISK_FULL is not one of them. The part onf Write AndX (page
269) does show NT_STATUS_DISK_FULL as a possible error.

Right now I see two options:
 - the list of errors possible in a Close response in the Microsoft
   CIFS documentation is not a complete list
 - NT_STATUS_DISK_FULL is not valid in a Close response

Regards,

Mathijs
-- 
"The present letter is a very long one, simply because I had no leisure to
make it shorter." - Blaise Pascal (1623-1662)


More information about the samba-technical mailing list