bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible bug in `du`


From: Paul Eggert
Subject: Re: Possible bug in `du`
Date: Wed, 28 Apr 2004 22:22:18 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Chris van O <address@hidden> writes:

> address@hidden chris]$ ls -ls /mnt/ralph/data/video1.mpg
> 1048576 -rw-r-----  1 1000 suse 1595396 Apr 27 18:03 
> /mnt/ralph/data/video1.mpg
> address@hidden chris]$ strace -v du /mnt/ralph/data/video1.mpg 2>&1 | grep 
> 'video1'
> execve("/usr/bin/du", ["du", "/mnt/ralph/data/video1.mpg"], [/* 58 vars */]) 
> = 0
> lstat64("/mnt/ralph/data/video1.mpg", {st_dev=makedev(0, 18), st_ino=6096, 
> st_mode=S_IFREG|0640, st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, 
> st_blocks=2097152, st_size=1595396, st_atime=2004/04/27-18:03:58, 
> st_mtime=2004/04/27-18:03:58, st_ctime=2004/04/27-18:04:15}) = 0
> write(1, "1048576\t/mnt/ralph/data/video1.m"..., 35
> 1048576      /mnt/ralph/data/video1.mpg

"du" and "ls" are reporting the numbers that they are given by the
kernel.  lstat64 reports st_size=1595396, which is the size "ls" is
reporting.  lstat64 also reports st_blocks=2097152, which (if true)
would mean that 2,097,152*512 == 1,073,741,824 bytes are allocated for
that file; this explains why "du" claims about 1 GB is allocated.

My guess is that your smbfs configuration is bollixed up somehow, and
this is messing up st_blocks.  Perhaps it is a Samba bug, or a kernel
bug, or a bug in the remote server.  It's also theoretically possible
(but I think unlikely) that your filesystem actually is allocating 1
GB for the file, even though it's only using 1.5 MB.

Other people have reported similar problems, e.g. see:

Adam Sampson
Odd st_blocks values from smbfs in 2.6.0-test8 (2003-10-24)
http://lkml.org/lkml/2003/10/24/158




reply via email to

[Prev in Thread] Current Thread [Next in Thread]