Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Mar 2001 17:00:36 +0900 (JST)
From:      MORI Kouji <mori@tri.asanuma.co.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/25724: quota(1) outputs wrong limits about nfs quota
Message-ID:  <20010312.170036.74756375.mori@tri.asanuma.co.jp>

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

>Number:         25724
>Category:       bin
>Synopsis:       quota(1) outputs wrong limits about NFS quota
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 12 00:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Koji Mori
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Techinical Reserach Institute, Asanuma Corp., Takatsuki, Japan
>Environment:

	FreeBSD 4.2-stable (nfs client), NetBSD 1.5 (nfs server)

>Description:

	quota(1) has int overflow problem in getnfsquota().

	I set soft/hard limits to 5GB on remote system (NetBSD),
	and view quota on FreeBSD.
	I got follow output.  Soft/hard limits is too small.

     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
           /.u0 1980574* 805696  805696    none    9983       0       0        

	I expected follow output.

     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
           /.u0 1980574 5000000 5000000            9983       0       0        

>How-To-Repeat:

	Show big quota (ex. 5GB) on NFS mounted file system with quota.

>Fix:

	This patch is for src/usr.bin/quota/quota.c rev.1.11.2.1.

--- quota.c	2000/07/02 09:57:51	1.11.2.1
+++ quota.c	2001/03/12 02:59:15
@@ -641,13 +641,13 @@
 	case Q_OK:
 		gettimeofday(&tv, NULL);
 			/* blocks*/
-		dqp->dqb_bhardlimit =
+		dqp->dqb_bhardlimit = (u_quad_t)
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit *
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE;
-		dqp->dqb_bsoftlimit =
+		dqp->dqb_bsoftlimit = (u_quad_t)
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit *
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE;
-		dqp->dqb_curblocks =
+		dqp->dqb_curblocks = (u_quad_t)
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks *
 		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE;
 			/* inodes */

>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?20010312.170036.74756375.mori>