bug-coreutils
[Top][All Lists]
Advanced

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

bug#11406: Bug? df uses f_bsize instead of f_frsize to calculate file sy


From: Nikolaus Rath
Subject: bug#11406: Bug? df uses f_bsize instead of f_frsize to calculate file system sizes
Date: Fri, 04 May 2012 22:23:16 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120329 Icedove/10.0.3

On 05/04/2012 02:56 PM, Paul Eggert wrote:
>> Am I missing something?
> 
> Hard to day.  You don't mention which operating system you're
> using. 

Linux 3.2 with eglibc 2.13.

> Looking at the source code, if
> df uses statvfs, and if f_frsize is not nonsense, df
> should be using f_frsize, so I don't see a bug here.
> However, I'm looking at the lastest source code, whereas
> you're running something older.
> 
> I suggest doing the following, if possible:
> 
> * Use the latest version of coreutils instead; currently
>   it's 8.16.
> 
> * Trace what system calls it's using, e.g., with 'strace'
>   on GNU/Linux.
> 
> * See what the system call is actually reporting.

The same happens with a freshly compiled 8.16, and it seems
that df uses statfs instead of statvfs:

# src/df --version
df (GNU coreutils) 8.16
[...]

# strace -v src/df -h ~/tmp/mnt
[...]
stat("/home/nikratio/tmp/mnt", {st_dev=makedev(0, 23), st_ino=1, 
st_mode=S_IFDIR|0755, st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=131072, 
st_blocks=0, st_size=0, st_atime=2012/05/04-22:13:30, 
st_mtime=2012/05/04-22:13:18, st_ctime=2012/05/04-22:13:18}) = 0
statfs("/home/nikratio/tmp/mnt", {f_type=0x65735546, f_bsize=81920, 
f_blocks=104857, f_bfree=104854, f_bavail=104854, f_files=1000000, 
f_ffree=999994, f_fsid={0, 0}, f_namelen=0, f_frsize=10485760}) = 0

[...] 

Any idea what might be happening here?


Best,

   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C





reply via email to

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