[Bug 224040] edquota -h omits B prefix when diskusage <= 8kBytes
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sat Dec 2 19:05:50 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224040
Bug ID: 224040
Summary: edquota -h omits B prefix when diskusage <= 8kBytes
Product: Base System
Version: 10.4-STABLE
Hardware: amd64
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: bin
Assignee: freebsd-bugs at FreeBSD.org
Reporter: bugReporter at ib-haakh.de
Hi,
edquota psh leads to
Quotas for user psh:
/datM: in use: 11656956k, limits (soft = 29360128k, hard = 31457280k)
inodes in use: 3742, limits (soft = 10000, hard = 15000)
/datV: in use: 8k, limits (soft = 8000k, hard = 10240k)
inodes in use: 1, limits (soft = 10000, hard = 15000)
which is fine. You can edit and save your choices
edquota -h psh:
Quotas for user psh:
/datM: in use: 11G, limits (soft = 28G, hard = 30G)
inodes in use: 3742, limits (soft = 10k, hard = 15k)
/datV: in use: 8192, limits (soft = 8000K, hard = 10M)
inodes in use: 1, limits (soft = 10k, hard = 15k)
------------------^^ missing prefix B
causes
edquota: /datV: in use: 8192, limits (soft = 8000K, hard = 10M): bad format
with the patch applied:
edquota -h psh leads to
Quotas for user psh:
/datM: in use: 11G, limits (soft = 28G, hard = 30G)
inodes in use: 3742, limits (soft = 10k, hard = 15k)
/datV: in use: 8192B, limits (soft = 8000K, hard = 10M)
inodes in use: 1, limits (soft = 10k, hard = 15k)
and the error is gone when saving changed values.
The fix is simple:
--- usr.sbin/edquota/edquota.c (Revision 326108)
+++ usr.sbin/edquota/edquota.c (Arbeitskopie)
@@ -506,7 +506,7 @@
if (hflag) {
humanize_number(numbuf, blocks < 0 ? 7 : 6,
- dbtob(blocks), "", HN_AUTOSCALE, HN_NOSPACE);
+ dbtob(blocks), "", HN_AUTOSCALE, HN_B | HN_NOSPACE);
return (numbuf);
}
snprintf(numbuf, sizeof(numbuf), "%juk", (uintmax_t)dbtokb(blocks));
regards
Andreas
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list