From le@univie.ac.at  Fri Aug 23 06:40:58 2002
Return-Path: <le@univie.ac.at>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B867037B400
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Aug 2002 06:40:58 -0700 (PDT)
Received: from pcle2.cc.univie.ac.at (pcle2.cc.univie.ac.at [131.130.2.177])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3B94143E84
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Aug 2002 06:40:57 -0700 (PDT)
	(envelope-from le@univie.ac.at)
Received: from pcle2.cc.univie.ac.at (localhost [127.0.0.1])
	by pcle2.cc.univie.ac.at (8.12.5/8.12.5) with ESMTP id g7NDetWN003423
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Aug 2002 15:40:55 +0200 (CEST)
	(envelope-from le@pcle2.cc.univie.ac.at)
Received: (from le@localhost)
	by pcle2.cc.univie.ac.at (8.12.5/8.12.5/Submit) id g7NDetZQ003422;
	Fri, 23 Aug 2002 15:40:55 +0200 (CEST)
Message-Id: <200208231340.g7NDetZQ003422@pcle2.cc.univie.ac.at>
Date: Fri, 23 Aug 2002 15:40:55 +0200 (CEST)
From: Lukas Ertl <le@univie.ac.at>
Reply-To: Lukas Ertl <le@univie.ac.at>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] edquota units are shown as blocks, but are kbytes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         41936
>Category:       bin
>Synopsis:       [PATCH] edquota units are shown as blocks, but are kbytes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    schweikh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 23 06:50:01 PDT 2002
>Closed-Date:    Sat Aug 31 09:38:05 PDT 2002
>Last-Modified:  Sat Aug 31 09:38:05 PDT 2002
>Originator:     Lukas Ertl
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
Vienna University Computer Center
>Environment:
System: FreeBSD pcle2.cc.univie.ac.at 4.6-STABLE FreeBSD 4.6-STABLE #0: Mon Aug 19 19:18:42 CEST 2002 le@pcle2.cc.univie.ac.at:/usr/obj/usr/src/sys/PCLE2 i386


	
>Description:

The units shown in /usr/sbin/edquota ("blocks in use", "soft limit", 
"hard limit") are called "blocks" but really are kbytes, which is quite 
confusing.

>How-To-Repeat:

configure a filesystem with quotas, run "edquota <user>".

>Fix:

	

--- edquota.diff begins here ---
--- edquota.c	Fri Aug 23 15:24:45 2002
+++ edquota.c.new	Fri Aug 23 15:28:20 2002
@@ -423,7 +423,7 @@
 	fprintf(fd, "Quotas for %s %s:\n", qfextension[quotatype], name);
 	for (qup = quplist; qup; qup = qup->next) {
 		fprintf(fd, "%s: %s %lu, limits (soft = %lu, hard = %lu)\n",
-		    qup->fsname, "blocks in use:",
+		    qup->fsname, "kbytes in use:",
 		    (unsigned long)(dbtob(qup->dqblk.dqb_curblocks) / 1024),
 		    (unsigned long)(dbtob(qup->dqblk.dqb_bsoftlimit) / 1024),
 		    (unsigned long)(dbtob(qup->dqblk.dqb_bhardlimit) / 1024));
@@ -474,7 +474,7 @@
 			return (0);
 		}
 		cnt = sscanf(cp,
-		    " blocks in use: %lu, limits (soft = %lu, hard = %lu)",
+		    " kbytes in use: %lu, limits (soft = %lu, hard = %lu)",
 		    &curblocks, &bsoftlimit, &bhardlimit);
 		if (cnt != 3) {
 			warnx("%s:%s: bad format", fsp, cp);
--- edquota.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: schweikh 
State-Changed-When: Sat Aug 24 04:04:01 PDT 2002 
State-Changed-Why:  
Committed to -current. Thanks! 


Responsible-Changed-From-To: freebsd-bugs->schweikh 
Responsible-Changed-By: schweikh 
Responsible-Changed-When: Sat Aug 24 04:04:01 PDT 2002 
Responsible-Changed-Why:  
My MFC reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41936 

From: "Artem 'Zazoobr' Ignatjev" <timon@memphis.mephi.ru>
To: Lukas Ertl <le@univie.ac.at>, freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/41936: [PATCH] edquota units are shown as blocks, but are kbytes
Date: Mon, 26 Aug 2002 13:53:25 +0400

 On Fri, Aug 23, 2002 at 03:40:55PM +0200, Lukas Ertl wrote:
 > 
 > >Number:         41936
 > >Synopsis:       [PATCH] edquota units are shown as blocks, but are kbytes
 > >Class:          sw-bug
 > The units shown in /usr/sbin/edquota ("blocks in use", "soft limit", 
 > "hard limit") are called "blocks" but really are kbytes, which is quite 
 > confusing.
 > --- edquota.c	Fri Aug 23 15:24:45 2002
 > +++ edquota.c.new	Fri Aug 23 15:28:20 2002
 > @@ -423,7 +423,7 @@
 >  	fprintf(fd, "Quotas for %s %s:\n", qfextension[quotatype], name);
 >  	for (qup = quplist; qup; qup = qup->next) {
 >  		fprintf(fd, "%s: %s %lu, limits (soft = %lu, hard = %lu)\n",
 > -		    qup->fsname, "blocks in use:",
 > +		    qup->fsname, "kbytes in use:",
 >  		    (unsigned long)(dbtob(qup->dqblk.dqb_curblocks) / 1024),
 >  		    (unsigned long)(dbtob(qup->dqblk.dqb_bsoftlimit) / 1024),
 >  		    (unsigned long)(dbtob(qup->dqblk.dqb_bhardlimit) / 1024));
 > @@ -474,7 +474,7 @@
 >  			return (0);
 >  		}
 >  		cnt = sscanf(cp,
 > -		    " blocks in use: %lu, limits (soft = %lu, hard = %lu)",
 > +		    " kbytes in use: %lu, limits (soft = %lu, hard = %lu)",
 >  		    &curblocks, &bsoftlimit, &bhardlimit);
 >  		if (cnt != 3) {
 >  			warnx("%s:%s: bad format", fsp, cp);
 > --- edquota.diff ends here ---
 	Maybe it should be better not to divide by 1024, but use
 BLOCKSIZE environment variable?
 			Sinceherely yours, Artem 'Zazoobr' Ignatjev.
State-Changed-From-To: patched->closed 
State-Changed-By: schweikh 
State-Changed-When: Sat Aug 31 09:35:24 PDT 2002 
State-Changed-Why:  
Committed to -stable. No, we don't want to divide by blocksize 
as it is not clear to the user how big a block is (and the 
block size may differ across file systems). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41936 
>Unformatted:
