linux (but not samba) quotas

Jeremy Allison jeremy at
Wed Mar 28 15:56:58 GMT 2001

David Collier-Brown wrote:
>         This reproduces the symptom reported: a file is written,
>         sometimes in odd orders, and when closed
>         - appears to be of the desired size, but
>         - actually contains "large blocks of nulls" (i.e., is holey)

Yes, this is a generic difference between Windows semantics
and POSIX that is annoying.

Under POSIX, seeking past the end of a file and doing a one
byte write creates a "holey" file, whose size is reported as
the seek size + 1. Under NT, this actually reserves the data
space needed on disk.

The only way to fix this under Samba POSIX is to force writes of
zero bytes in the intermediate space when extending a file.
That way, out of space errors can be reported at the time NT
expects to see them.

This is something we haven't yet done, but could be added as
an option. I'll look into this.

There are other nasty differences that I doubt Microsoft
has thought much about. For instance, has anyone set up
NT quotas and then used the new code in smbcacls to chown
a file owner to get around quota limits for a user ? :-).

As such a thing isn't possible under the Win32 API's without
having admin privs (although it's perfectly simple over the
network interface) I wonder if they designed their quota
support with this in mind.... :-) :-).


Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list