[887] in testers

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

re: quotacheck typo, plus another bug-fix

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Fri May 25 10:33:34 1990

From: jnrees@ATHENA.MIT.EDU
Date: Fri, 25 May 90 10:33:08 -0400
To: testers@ATHENA.MIT.EDU
In-Reply-To: [0878]

Yup, I noticed that late yesterday, and also worked on another fix.
Currently, if a user has zero usage, though the quota file thinks he
does, his record does not get fixed.  This has caused occassional
problems in the past, where a user who got a new quota on a filesystem
could not write any files because he was 'over quota'.  The only thing
to do was to chown a file to him, then run a quotacheck.  I also
removed an unused variable 'i' which the RT compiler always complained
about.

*** /tmp/,RCSt1002794	Fri May 25 10:25:49 1990
--- /tmp/,RCSt2002794	Fri May 25 10:25:50 1990
***************
*** 1,4 ****
! /* $Header: /mit/groupquota/src/quotacheck/quotacheck.c,v 1.2 90/05/23 14:32:56 jnrees Exp $
  */
  
  /*
--- 1,4 ----
! /* $Header: /mit/groupquota/src/quotacheck/quotacheck.c,v 1.3 90/05/25 10:20:55 jnrees Exp $
  */
  
  /*
***************
*** 53,58 ****
--- 53,59 ----
  
  #define QFNAME "quotas"
  struct dqblk zerodqbuf;
+ struct fileusage zerofileusage;
  
  main(argc, argv)
  	int argc;
***************
*** 63,69 ****
  	int listcnt;
  	char quotafile[MAXPATHLEN + 1];
  	FILE *mtab, *fstab;
- 	int i;
  	int errs = 0;
  
  again:
--- 64,69 ----
***************
*** 194,210 ****
  		for (i = 0; i < sblock.fs_ipg; i++)
  			acct(ginode(), groupmode);
  	}
! 	for (uid = 0; uid <= highuid; uid++) {
  		fup = lookup(uid);
! 		if (fup == 0)
! 			continue;
  		fseek(qf, (long)dqoff(uid), 0);
  		i = fread(&dqbuf, sizeof(struct dqblk), 1, qf);
  		if (i == 0)
  			dqbuf = zerodqbuf;
  		if (dqbuf.dqb_curfiles == fup->fu_curfiles &&
! 		    dqbuf.dqb_curblocks == fup->fu_curblocks) {
! 			if (vflag) {
  			  if (groupmode){
  			    grp = getgrgid(uid);
  			    if (grp != NULL)
--- 194,210 ----
  		for (i = 0; i < sblock.fs_ipg; i++)
  			acct(ginode(), groupmode);
  	}
! 	for (uid = 0; uid <= 32767; uid++) {
  		fup = lookup(uid);
! 		if (fup == 0) fup = &zerofileusage;
  		fseek(qf, (long)dqoff(uid), 0);
  		i = fread(&dqbuf, sizeof(struct dqblk), 1, qf);
  		if (i == 0)
  			dqbuf = zerodqbuf;
  		if (dqbuf.dqb_curfiles == fup->fu_curfiles &&
! 		    dqbuf.dqb_curblocks == fup->fu_curblocks){
! 			if (vflag &&
! 			    (fup->fu_curfiles || fup->fu_curblocks)){
  			  if (groupmode){
  			    grp = getgrgid(uid);
  			    if (grp != NULL)
***************
*** 229,235 ****
  		if (groupmode){
  		  grp = getgrgid(uid);
  		  if (grp != NULL)
! 		    printf("%-10s fixes:", grp->gr_name);
  		  else
  		    printf("#%-9d fixed:", uid);
  		}
--- 229,235 ----
  		if (groupmode){
  		  grp = getgrgid(uid);
  		  if (grp != NULL)
! 		    printf("%-10s fixed:", grp->gr_name);
  		  else
  		    printf("#%-9d fixed:", uid);
  		}

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