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: Tue, 15 May 2012 18:45:52 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120329 Icedove/10.0.3

On 05/15/2012 06:10 AM, Pádraig Brady wrote:
On 05/14/2012 09:34 AM, Pádraig Brady wrote:
On 05/12/2012 05:05 AM, Paul Eggert wrote:
On 05/11/2012 06:56 PM, Nikolaus Rath wrote:
Yes, this works:

OK, thanks, I pushed that patch into gnulib, where
coreutils should eventually pick it up.

I just noticed that the "stat" command is affected by this as well:

Ouch.  Perhaps Padraig can look at that one -- this
statvfs stuff is a bit of a rat's nest, alas.

One thought is that perhaps we should create a gnulib
module statvfs that works around the GNU/Linux bug?  Then other code
could simply call statvfs without worrying about this stuff.


I'll have a look at this sometime this evening.

Yes this is messy. Note even though STAT_STATVFS is now true
since Paul's gnulib change, stat(1) wants access to the f_type member
which is not available in the statvfs structure.
However frsize is available in the statfs structure since kernel 2.6,
so we can use that where available.

Nikolaus, could you try the stat command again with the following?

Yes, that works nicely.

# src/stat -f ~/tmp/mnt
  File: "/home/nikratio/tmp/mnt"
    ID: 0        Namelen: 0       Type: fuseblk
Block size: 8192       Fundamental block size: 4096
Blocks: Total: 268435456  Free: 268435456  Available: 268435456
Inodes: Total: 1000000    Free: 999997

# /usr/bin/stat -f ~/tmp/mnt
  File: "/home/nikratio/tmp/mnt"
    ID: 0        Namelen: 0       Type: fuseblk
Block size: 8192       Fundamental block size: 8192
Blocks: Total: 268435456  Free: 268435456  Available: 268435456
Inodes: Total: 1000000    Free: 999997

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]