From owner-freebsd-bugs@freebsd.org Sat Dec 2 19:05:50 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB39E672A7 for ; Sat, 2 Dec 2017 19:05:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DD7379F74 for ; Sat, 2 Dec 2017 19:05:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id vB2J5nDY096292 for ; Sat, 2 Dec 2017 19:05:49 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 224040] edquota -h omits B prefix when diskusage <= 8kBytes Date: Sat, 02 Dec 2017 19:05:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.4-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bugReporter@ib-haakh.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Dec 2017 19:05:50 -0000 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.=