Quota

David Lee t.d.lee at durham.ac.uk
Mon Dec 17 07:11:23 GMT 2001


On Mon, 17 Dec 2001, Yaroslav Buga wrote:

> I have a question about quota support in SAMBA. I compiled SAMBA with quota 
> support and setup quota for user. When I write a file to my SAMBA server it 
> truncates its size to quota size and doesn't warn me about that. How can I 
> setup warnings for users who exceed their quotas?

Presumably by "truncates its size to quota size" you mean it prevents the
file exceeding the *remaining* size of your quota.  (If this is the only
file interacting with the quota then those two concepts amount to the same
thing.  But in general some of the quota will already be eaten into by
other files of that user on that volume.

You say it "doesn't warn me": well it won't actually warn you.  Rather,
the write that causes it to exceed the quota will simply fail.  The
application on the PC (samba client) would hopefully detect this and
itself warn you.  This behaviour should be independent of whether the
fileserver is Windows-based or Samba (and, indeed, of whether the limit it
hits is quota-based or physical-filesystem-based). 

If you start from a UNIX background, then it is tempting to expect
samba+quotas to do more than is actually possible within the constraints
of the SMB protocol.  The SMB protocol cannot carry UNIX-quota subtleties
of hard and soft limits.

As a working rule-of-thumb, imagine that quotas can provide only a simple,
relatively small, virtual disk, whose size limit is its own, rather than
that of the underlying physical disk.  Nothing more.  Put another way: if
you are from a UNIX background: the "df"-equivalent functionality is now
returning quota-based figures, based on one of those limits.  I forget
whether it is hard or soft (and the code might indicate which).

Now it would, in theory, be possible to adjust Samba to warn the user if
they were doing things around about their limit.  Note that any such
functionality would be over-and-above what a Windows fileserver would do. 
This is not necessarily a Good Thing: there are decent arguments both
ways. 

For instance, I've been toying with the idea of generalised "WinPopup" 
functionality from Samba back to the client, and one of the uses I had in
mind was to provide just such indications from significant quota-related
events.  Others include allowing UNIX "write" and "wall" commands to work
"out-of-the-box".  But at present this is not much more than a gleam in my
eye (although I have test-coded and demonstrated the general Popup
functionality and demonstrated it with "write" etc.).  I hope to persuade
the Samba Team to accept the possibility of such WinPopup support.  But as
regards re-doing the quota code to support it, at the very least more
thought will be necessary, and it would probably not make sense even to
contemplate coding until the quota code is under VFS support.

Hope that helps.


-- 

:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham                :
:  Phone: +44 191 374 2882                  U.K.                  :





More information about the samba-technical mailing list