[BusyBox] bug#1158: can of worms

Erik Andersen andersen at lineo.com
Tue Jul 3 21:28:54 UTC 2001


On Fri Apr 27, 2001 at 04:19:43PM -0700, Larry Doolittle wrote:
> This bug report raises all sorts of other problems.
> The "fix" as given is inadequate.
> 
>  -- a file size of 1.2K still comes out as 1.0K.
> 
>  -- du.c assumes stat.st_blocks are 512 bytes, and
>     chops the fraction.  If run on a filesystem that
>     can allocate single blocks (unlike ext2), a whole
>     directory full of 400 byte files will show up as
>     zero size.
> 
>  -- It doesn't seem right to need floating point (double
>     or long double) computation in make_human_readable_str
>     and df.c.
> 
> I know there have been long arguments on comp.unix.programmer
> about whether or not stat.st_blksize*stat.st_blocks was _always_
> an accurate rendition of the size of the file.  I _think_ it
> is a safe bet on Linux.

With the update to make_human_readable_str() to take a size, a block size, and
a display unit, and with Manuel's changes to avoid bit shifting overflows, we
are now in good shape and these problems don't happen any more.

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list