Comment 9 for bug 416981

Revision history for this message
rooijan (rrossouw) wrote :

In my particular case the problem is that coreutils probably picks none or the wrong value for ST_NBLOCKS for the VBOXSF file system. I looked at the du source in the coreutils-7.4 source and it appears like ST_NBLOCKS are not getting set. Problem is most likely in system.h where ST_NBLOCKS should be set.

In du.c where file size is not computed correctly.
duinfo_set (&dui,(apparent_size? sb->st_size
     : (uintmax_t) ST_NBLOCKS (*sb) * ST_NBLOCKSIZE), <------ ST_NBLOCKS is incorrect ----------->
    (time_type == time_mtime ? get_stat_mtime (sb): time_type == time_atime ? get_stat_atime (sb):get_stat_ctime (sb)));

If "apparent size" is used to compute the file size du works correctly. So using "du -bh" or "du -sh --apparent-size" works correctly. Let me know if there is anything else you want me to test in my particular case.