Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156049 - coreutils-6.4 du reports incorrect sub-directory sizes when using -x
Summary: coreutils-6.4 du reports incorrect sub-directory sizes when using -x
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://lists.gnu.org/archive/html/bug...
Whiteboard:
Keywords:
: 157884 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-23 11:14 UTC by David Leinbach
Modified: 2007-03-29 18:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Example of problem (test.tar.gz,1.85 KB, application/octet-stream)
2006-11-28 14:18 UTC, David Leinbach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Leinbach 2006-11-23 11:14:11 UTC
Running "du -hscx" from coreutils-6.4 reports incorrect sizes for sub-directories.  This is on a reiserfs file system.

Ex.
user@host ~/temp2 $ du -hscx *
4.0K    config.inc.php
0       images
0       include
4.0K    index.php
4.0K    leftsidebar.inc.php
0       modules
4.0K    rightsidebar.inc.php
0       scripts
4.0K    session.inc.php
20K     total
user@host ~/temp2 $ du -hscx include/*
12K     include/CVS
4.0K    include/general.inc.php
4.0K    include/log.inc.php
4.0K    include/modules.inc.php
4.0K    include/properties.inc.php
8.0K    include/session.inc.php
36K     total
user@host ~/temp2 $

This worked fine in coreutils-5.94-r1

Output of emerge --info:
Portage 2.1.1-r2 (default-linux/x86/2006.1/desktop, gcc-3.4.6, glibc-2.4-r3, 2.6.16-gentoo-r11 i686)
=================================================================
System uname: 2.6.16-gentoo-r11 i686 Intel(R) Pentium(R) 4 CPU 2.66GHz
Gentoo Base System version 1.12.6
Last Sync: Thu, 23 Nov 2006 01:47:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.3.5-r2, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/terminfo"
CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://adelie.polymtl.ca/ ftp://cs.ubishops.ca/pub/gentoo ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apache2 apm berkdb bitmap-fonts bzlib cairo cdr cli cracklib crypt cups curl curlwrappers dbus dga dlloader dri dvd dvdr eds elibc_glibc emboss encode fam firefox fortran gd gdbm gif gpm gstreamer gtk gtk2 hal iconv imlib input_devices_keyboard input_devices_mouse isdnlog java jikes jpeg junit kernel_linux libg++ libwww mad maildir mikmod mmx mp3 mpeg mysql ncurses nls nptl nptlonly nsplugin oci8 ogg opengl oracle oss pam pcre pdflib perl php png ppds pppd python qt qt3 qt4 quicktime readline reflection samba sdl session slang snmp spell spl sse ssl tcpd truetype truetype-fonts type1-fonts udev unicode usb userland_GNU video_cards_fbdev video_cards_i810 video_cards_vesa video_cards_vga vorbis win32codecs xml xml2 xorg xsl xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2006-11-26 07:22:20 UTC
could you please make a tarball of a directory showing the problem and post it as an attachment ?  also, could you try coreutils-6.6 and see if it has the same problem ?
Comment 2 David Leinbach 2006-11-28 14:18:31 UTC
Created attachment 102943 [details]
Example of problem

This tar.gz contains a directory called temp.  If you run "du -hscx" within the temp directory it will show:

316K    bigfile.txt
0       emptydir
0       nonemptydir
316K    total


However there is a copy of bigfile.txt in nonemptydir.
Comment 3 David Leinbach 2006-11-29 13:54:17 UTC
Yes, I am still encountering the problem under coreutils-6.6
Comment 4 David Leinbach 2006-11-30 11:33:14 UTC
Just to be absolutely sure, I downgraded coreutils to 5.94-r1 (the version I had before upgrading to 6.4) and the problem went away:

user@host ~/temp $ du -hscx *
316K    bigfile.txt
0       emptydir
316K    nonemptydir
632K    total
Comment 5 SpanKY gentoo-dev 2006-12-02 15:12:55 UTC
looks like just an issue when using -x and passing all the arguments into du:

[this one is OK]
$ du
324     ./nonemptydir
4       ./emptydir
652     .

[this one is OK]
$ du *
320     bigfile.txt
4       emptydir
324     nonemptydir

[this one is wrong]
$ du -x *
320     bigfile.txt
4       emptydir
4       nonemptydir
Comment 6 SpanKY gentoo-dev 2006-12-02 15:45:43 UTC
reproduced and e-mailed upstream
Comment 7 SpanKY gentoo-dev 2006-12-03 11:38:18 UTC
added upstream fix to cvs and it'll be in 6.6-r1 or 6.7, whichever comes sooner ;)
Comment 8 SpanKY gentoo-dev 2006-12-12 10:11:35 UTC
*** Bug 157884 has been marked as a duplicate of this bug. ***
Comment 9 David Leinbach 2007-03-29 18:01:43 UTC
I have verified that this no longer occurs with coreutils-6.7-r1