Bug 41936 - [PATCH] edquota units are shown as blocks, but are kbytes
Summary: [PATCH] edquota units are shown as blocks, but are kbytes
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 4.6-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jens Schweikhardt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-23 14:50 UTC by Lukas Ertl
Modified: 2002-08-31 17:38 UTC (History)
0 users

See Also:


Attachments
edquota.diff (843 bytes, patch)
2002-08-23 14:50 UTC, Lukas Ertl
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Ertl 2002-08-23 14:50:01 UTC
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>".
Comment 1 Jens Schweikhardt freebsd_committer freebsd_triage 2002-08-24 12:04:01 UTC
State Changed
From-To: open->patched

Committed to -current. Thanks! 


Comment 2 Jens Schweikhardt freebsd_committer freebsd_triage 2002-08-24 12:04:01 UTC
Responsible Changed
From-To: freebsd-bugs->schweikh

My MFC reminder.
Comment 3 Artem 'Zazoobr' Ignatjev 2002-08-26 10:53:25 UTC
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.
Comment 4 Jens Schweikhardt freebsd_committer freebsd_triage 2002-08-31 17:35:24 UTC
State Changed
From-To: patched->closed

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).