[BusyBox 0000524]: du gives wrong size

bugs at busybox.net bugs at busybox.net
Thu Nov 3 22:58:55 UTC 2005


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=524 
====================================================================== 
Reported By:                Dwight Engen
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   524
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             10-31-2005 05:42 PST
Last Modified:              11-03-2005 14:58 PST
====================================================================== 
Summary:                    du gives wrong size
Description: 
du assumes the stat() st_blocks field is in units of 512 instead of using
st_blksize.
====================================================================== 

---------------------------------------------------------------------- 
 landley - 11-03-05 14:58  
---------------------------------------------------------------------- 
No, it doesn't.  Did you actually see this bug, or try out your own patch? 
>From the lstat man page:

   The value st_blocks gives the size of  the  file  in  512-byte 
blocks.
   (This  may  be  smaller than st_size/512 e.g. when the file has
holes.)
   The value st_blksize gives the "preferred" blocksize for efficient
file
   system  I/O.  (Writing to a file in smaller chunks may cause an
ineffi-
   cient read-modify-rewrite.)

I applied your patch and tested, and it gave the wrong values.  Reverting
it gave the right values. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-31-05 05:42  Dwight Engen   New Issue                                    
10-31-05 05:42  Dwight Engen   Status                   new => assigned     
10-31-05 05:42  Dwight Engen   Assigned To               => BusyBox         
10-31-05 05:42  Dwight Engen   File Added: du.c.diff                        
11-03-05 14:58  landley        Note Added: 0000652                          
======================================================================




More information about the busybox-cvs mailing list