quota problems

Robert A. Thompson ucs_rat at shsu.edu
Thu Apr 25 18:34:01 GMT 2002

	please forgive me as I'm really new to this, and hope someone here
could help out or point me in the right direction.  
	We recently upgraded to the samba-2.2.3a on a redhat linux 7.2 box form
a really old samba-2.0.6 on the same box and started having problems
with users trying to save their profile on logoff.  They would get error
messages saying their profile couldn't be saved possible problems where
that they were out of disk space or no permission to the drive. 
However, the users were not over their quota.  I did some testing and
found everything worked as it should while the user was logged on they
could save things up to their soft limit and if they were not over their
grace period could save up to their hard limit before they were denied
access.  I'm guessing from what I have found so far that 2000 creates a
tmp file in the users profile during log off and uploads the data to
that tmp file then compares this at log off saving the changes.  It
seems to check if there is enough free space and if not it throws an
	I started going through the smbd/quota.c code and the comments says to
return diskfree as the softlimit until the softlimit is exceded then
return the hard limit.  However, this didn't seem to be happening.  It
seemed to be testing if the softlimit is 0 which isn't the case.  I
changed the code so that it checks to see if curblocks > softlimit(as
the patch shows) and this seems to have fixed the problem in testing. 
I'm gonna try this in production tomorrow tonight.  I have a feeling
there is still a slight chance that the user might still get the error
as they get closer to their softlimit (since this is reported back until
they go over), but it seems to be able to help a majority of the
problems we are seeing at the moment.
	Does anyone know if this is wrong or have they seen anything similar?


Robert A. Thompson



--- quotas.orig Thu Apr 25 20:07:40 2002
+++ quotas.c    Thu Apr 25 20:04:06 2002
@@ -212,7 +212,8 @@
        } else if (D.softlimit==0 && D.hardlimit==0) {
        } else {
-               if (D.softlimit == 0)
+               /* switch to hard limit if over softlimit */
+               if (D.softlimit < D.curblocks)
                        D.softlimit = D.hardlimit;
                *dfree = D.softlimit - D.curblocks;
                *dsize = D.softlimit;

More information about the samba-technical mailing list