[2036] in Athena Bugs

home help back first fref pref prev next nref lref last post

6.1C RT & VAX : quota system

daemon@ATHENA.MIT.EDU (Ilhamuddin Ahmed)
Wed Apr 5 02:20:30 1989

Date: Wed, 5 Apr 89 02:20:03 EDT
From: Ilhamuddin Ahmed <ilham@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU, rt-testers@ATHENA.MIT.EDU
Cc: ilham@ATHENA.MIT.EDU
Reply-To: ilham@ATHENA.MIT.EDU

There is the bug in quota (so you say what else is new :-)!! What
happens is that sometimes, the quota for some users become absurd (some
negative numbers or very high numbers. For example, when I logged in on
GARFIELD today, after installing quota properly, it gave me the
following error :

	DISK LIMIT REACHED (/site) - WRITE FAILED

Looking at quota :

Disk quotas for ilham (uid 3673):
Filesystem     usage  quota  limit    timeleft  files  quota  limit    timeleft
/site         253952 100000 500000    7.0 days    706      0      0            
		^
		|
	    I am actually using only 8MB locally

Then I ran quotacheck to fix this problem.  When another person logged
in remotely to garfield while I was logged in (who has a local quota on
garfield), both mine and his quota became corrupted.

The problem lies in the chkdq() [check disk quota usage] and chkiq()
[check inode quota usage] procedures of the ufs layer in the kernel. The
wonderful people at Sun Microsystems sometimes set values into disk
usage and inode usage caches in the kernel before is was set. The fix is
attached below and applies to both RT and VAX sources.

I built an RT kernel and tested it - seems to work fine. This still need
more beating though. I will build a kernel for myself on garfield once I
find out how to include AFS into the kernel.

							- Ilham

===============================================================================

*** /minos/sys/ufs/quota_ufs.c	Mon Feb 20 21:30:01 1989
--- /garfield/u1/sys/ufs/quota_ufs.c	Wed Apr  5 01:53:15 1989
***************
*** 87,95 ****
  	 * Allocation. Check hard and soft limits.
  	 * Skip checks for super user.
  	 */
  	if (u.u_uid == 0)
  		goto out;
- 	ncurblocks = dqp->dq_curblocks + change;
  	/*
  	 * Dissallow allocation if it would bring the current usage over
  	 * the hard limit or if the user is over his soft limit and his time
--- 87,95 ----
  	 * Allocation. Check hard and soft limits.
  	 * Skip checks for super user.
  	 */
+ 	ncurblocks = dqp->dq_curblocks + change;
  	if (u.u_uid == 0)
  		goto out;
  	/*
  	 * Dissallow allocation if it would bring the current usage over
  	 * the hard limit or if the user is over his soft limit and his time
***************
*** 172,180 ****
  	/*
  	 * Skip checks for super user.
  	 */
  	if (u.u_uid == 0)
  		goto out;
- 	ncurfiles = dqp->dq_curfiles + 1;
  	/*
  	 * Dissallow allocation if it would bring the current usage over
  	 * the hard limit or if the user is over his soft limit and his time
--- 172,180 ----
  	/*
  	 * Skip checks for super user.
  	 */
+ 	ncurfiles = dqp->dq_curfiles + 1;
  	if (u.u_uid == 0)
  		goto out;
  	/*
  	 * Dissallow allocation if it would bring the current usage over
  	 * the hard limit or if the user is over his soft limit and his time


home help back first fref pref prev next nref lref last post