Date: Sat, 02 Dec 2017 19:05:50 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 224040] edquota -h omits B prefix when diskusage <= 8kBytes Message-ID: <bug-224040-8@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
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@FreeBSD.org Reporter: bugReporter@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.help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-224040-8>
