File Size (EOF) and Allocation Size

Steven French sfrench at us.ibm.com
Thu Jul 31 16:33:46 GMT 2003





>http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=202396 and
>http://lists.samba.org/pipermail/samba/2003-July/099663.html

Your postings seem to describe multiple issues -
1) sparse files & exceeding quota (or getting disk full) - I find it
interesting how Linux filesystems like JFS can automatically treat regions
of files as sparse but this is normally transparent as long as the app
doesn't get confused at the concept of getting out of disk space writing to
the middle of a file.
2) mapping POSIX to NT STATUS return codes properly on exceeding quota so
explorer doesn't get confused copying files (it may turn out that the
problem with explorer is actually not the return code mapping but failing
deleting the target file after copy failure)

Although this is not something I have noticed it is fairly easy to
experiment with by setting Quotas on Windows 200x and Samba and comparing
network behavior on file copies.  In any case explicit support for setting
quotas remotely was a feature that I want to add to the cifs vfs eventually
and that would be a good chance to explore error mapping issues and also I
need to educate myself on the issue of v2 versus v3 quotas in kernel and
what Samba really supports.

On the issue of EOF and Allocation Size for the Linux client - I am testing
the approach of:
1) for oplocked files - don't set the file size (except for explicit
vfs_setatts) to the server.  Let the writebehind of the cache implicitly
increase the file size
2) for oplocked files ignore the file size that comes back from the server
on inode/dentry revalidates/lookups (trust the local view of the file size
- it comes back from the NTCreateX open response and is updated when local
cache write exceeds end of file)
3) Apps who desire immediate file size updates and more of a guarantee
against ever getting "out of disk space on close" can always specify write
through (which probably now has to be fixed in the cifs vfs code) or
explicit sync (which does work).



Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com




More information about the samba-technical mailing list