Skip site navigation (1)Skip section navigation (2)
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/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224040

            Bug ID: 224040
           Summary: edquota -h omits B prefix when diskusage <=3D 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 =3D 29360128k, hard =3D 31457280k)
        inodes in use: 3742, limits (soft =3D 10000, hard =3D 15000)
/datV: in use: 8k, limits (soft =3D 8000k, hard =3D 10240k)
        inodes in use: 1, limits (soft =3D 10000, hard =3D 15000)
which is fine. You can edit and save your choices

edquota -h psh:
Quotas for user psh:
/datM: in use: 11G, limits (soft =3D 28G, hard =3D 30G)
        inodes in use: 3742, limits (soft =3D 10k, hard =3D 15k)
/datV: in use: 8192, limits (soft =3D 8000K, hard =3D 10M)
        inodes in use: 1, limits (soft =3D 10k, hard =3D 15k)
------------------^^ missing prefix B
causes
edquota: /datV: in use: 8192, limits (soft =3D 8000K, hard =3D 10M): bad fo=
rmat

with the patch applied:
edquota -h psh leads to
Quotas for user psh:
/datM: in use: 11G, limits (soft =3D 28G, hard =3D 30G)
        inodes in use: 3742, limits (soft =3D 10k, hard =3D 15k)
/datV: in use: 8192B, limits (soft =3D 8000K, hard =3D 10M)
        inodes in use: 1, limits (soft =3D 10k, hard =3D 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

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-224040-8>