Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jan 2003 17:05:58 -0500 (EST)
From:      Eric van Gyzen <vangyzen@stat.duke.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/47607: quota(1) misreports nfs quotas >= 4 GB
Message-ID:  <200301282205.h0SM5wGg013035@floyd.isds.duke.edu>

next in thread | raw e-mail | index | archive | help


>Number:         47607
>Category:       bin
>Synopsis:       quota(1) misreports nfs quotas >= 4 GB
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 28 14:10:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Eric van Gyzen
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
ISDS, Duke University
>Environment:
System: FreeBSD floyd.isds.duke.edu 4.7-STABLE FreeBSD 4.7-STABLE #1: Fri Jan 17 15:44:11 EST 2003 vangyzen@floyd.isds.duke.edu:/build/obj/build/src/sys/FLOYD i386

>Description:
The quota(1) utility incorrectly reports quotas >= 4 GB (8388608 blocks)
on NFS-mounted filesystems.  When the getnfsquota() function adjusts the
quota values (limits, usage) based on the remote and local block sizes,
it removes the nine high-order bits of those values.

>How-To-Repeat:
nfs-server% quota
Disk quotas for user johndoe (uid 1000): 
     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
          /home  226255 4194303 4194304            6382       0       0        

nfs-client% quota
Disk quotas for user johndoe (uid 1000): 
     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
          /home  226255 4194303       0            6382       0       0        

>Fix:
--- usr.bin/quota/quota.c.orig	Tue Jan 21 13:40:10 2003
+++ usr.bin/quota/quota.c	Tue Jan 28 16:44:22 2003
@@ -632,13 +632,13 @@
 			/* blocks*/
 		dqp->dqb_bhardlimit =
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit *
-		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE;
+		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
 		dqp->dqb_bsoftlimit =
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit *
-		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE;
+		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
 		dqp->dqb_curblocks =
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks *
-		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE;
+		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
 			/* inodes */
 		dqp->dqb_ihardlimit =
 			gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit;

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301282205.h0SM5wGg013035>