bug#11406: Bug? df uses f_bsize instead of f_frsize to calculate file sy
From:
Jim Meyering
Subject:
bug#11406: Bug? df uses f_bsize instead of f_frsize to calculate file system sizes
Date:
Fri, 11 May 2012 12:42:51 +0200
Andreas Schwab wrote:
> Paul Eggert <address@hidden> writes:
>
>> On 05/10/2012 04:04 PM, Nikolaus Rath wrote:
>>> But why isn't
>>> it du using statvfs instead of statfs?
>>
>> m4/fsusage.m4 says why:
>>
>> Do not use statvfs on systems with GNU libc on Linux, because that function
>> stats all preceding entries in /proc/mounts, and that makes df hang if even
>> one of the corresponding file systems is hard-mounted, but not available.
>
> This is no longer true if the kernel is at least 2.6.36.
It's tempting to add a configure-time kernel version test, but those (both
the configure-time part and the version-number test) can cause trouble.
I'd prefer a run-time feature test if it were cheap enough, but even then,
the statfs/statvfs choice must currently be made before compiling, due
to differing sets of member names.
Finally, it's not clear that there is even a problem with our
current use of statfs on glibc-based Linux systems.