[Samba] Samba + Linux ext3/FS + As/400 + Quotas

Johannes Niess j.niess at uni-bonn.de
Mon Aug 4 16:27:51 GMT 2003

Nicolas Silvestre <nicolas.silvestre at aliacom.fr> writes:

> Hi,
> Thank you for your help. You're right for the version : it's 2.2.3.
> I checked on the ftp server of SuSE the compile options used to build
> the binaries. "--with-quotas" is mentionned. So, it's strange.
> The last chance to go further is to compile Samba on the AS/400 but
> I'm not close to it for one month.
> The next part of your mail deals about the strange behaviour of
> quotas. I also made tests on Samba 2.2.8/SuSE Linux 8.1
> professional/Client NT4.
> I got file truncation, and also differents displays between Linux and
> WinNT4 due to "copy on write" mode on WinNT4 I suppose
> Nicolas Silvestre
> Johannes Niess wrote:
> >>>- samba 2.2.23
> > This version does not exist.
> > You have to recompile "./configure --with-quota" to get the quota
> > displayed as share size. It is not enabled by most vendor binaries.
> > You need extensive testing for correctnes. On i386 linux I got silent
> > file truncations when exceeding quota. I just copied files with W2k
> > explorer. Unfortunately the Samba team could not reproduce it
> > (yet). For me it happens even without quota when the real (floppy)
> > disk is full.. Quota just triggers it earlier.
> > Reason seems to be "sparse" files. Sometimes Windows does a strange
> > test for disk space: A new file is opened and seeked to the last byte
> > of data to be written. Then the last byte is written and the return
> > code used.
> > Unix tries to be smart and does a kind of run length encoding for all
> > these unused bytes that have been seeked over. This is accounted with
> > it's compressed size for quota. So the test succeeds and Windows does
> > no further error checking. Samba is bound to Unix quota restrictions
> > and the client has no way to reask the status. The  file is truncated
> > at quota boundary and ext3 displays full file size to the client.
> > Setting "strict allocate = yes" in smb.conf is supposed to help, but
> > it does not for me in this case.
> > Please report negative _and_ positive test results here to establish
> > some statistics. Maybe we can find the pattern where things go wrong.
> > Johannes Nieß

I've made level 5 debug logs with W98SE as client. You can find them
on samba-technical. The Debian woody package of Samba 2.2.3a is
compiled without quota and does not show the bug. I used a floppy disk
as a test share. On a different Debian Wody machine I recompiled with
quota and it truncated files.

It looks like at least Samba 2.2.3a and 2.2.8a can have this behavior,
but there might be other components involved, e.g. libc. At the moment
I don't have a clue .Please Give the US-based samba team members a chance
to see through the logs. Did you contact Suse Support? They have a new
contract with Volker Lendekes Sernet company.

The ultimate test would be two compilations on the same server and
with the same client. It looks like I need to do that. A workaround
might be to not use "--with-quotas", but use the  "dfree command"
setting in smb.conf to show quotas. It might kill performance. What I
really want is a per share and per user quota. Maybe via a tcp
connection to a simple daemon. But that might be a wishlist item for a
vfs module in Samba 3. 

Johannes Nieß

More information about the samba mailing list