From nobody@FreeBSD.org  Fri Sep 19 10:32:48 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 889B0106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Sep 2008 10:32:48 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 77B7F8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Sep 2008 10:32:48 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m8JAWljA053461
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Sep 2008 10:32:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m8JAWlGW053459;
	Fri, 19 Sep 2008 10:32:47 GMT
	(envelope-from nobody)
Message-Id: <200809191032.m8JAWlGW053459@www.freebsd.org>
Date: Fri, 19 Sep 2008 10:32:47 GMT
From: Sren Klintrup <soren@klintrup.dk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ls -lh display wrong filesize
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         127495
>Category:       bin
>Synopsis:       ls -lh display wrong filesize
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 19 10:40:01 UTC 2008
>Closed-Date:    Fri Sep 19 13:17:49 CEST 2008
>Last-Modified:  Fri Sep 19 13:17:49 CEST 2008
>Originator:     Sren Klintrup
>Release:        6.3 and 7.0
>Organization:
>Environment:
FreeBSD localhost 7.0-RELEASE-p4 FreeBSD 7.0-RELEASE-p4 #0: Tue Sep  2 18:48:24 UTC 2008     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
$ ls -l test1
-rw-r--r--  1 x  y  1048559029 Sep 19 11:52 test1
$ ls -lh test1
-rw-r--r--  1 x  y   1000 Sep 19 11:52 test1

Filesize does not have to be exactly 1048559029 bytes, everything in that range seems to give the same output.

Tested and verified on 3 different systems:
7.0 amd64 using ufs (generic kernel from freebsd-update)
7.0 amd64 using zfs (custom kernel)
6.3 i386 using ufs (jail, custom kernel)
>How-To-Repeat:
You can use my testfile from http://soren.klintrup.dk/ls_display_testfile.bz2

or you can generate your own file by using the command:

dd if=/dev/zero of=ls_display_testfile bs=1000 count=1048564
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: tobez 
State-Changed-When: Fri Sep 19 13:16:11 CEST 2008 
State-Changed-Why:  
Known problem. 
Fixed in src/lib/libutil/humanize_number.c 1.3 on 2008/03/08; 
MFCed to RELENG_7 and RELENG_6 on 2008/04/20. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127495 
>Unformatted:
