mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Stephan van Hienen <kernel@a2000.nu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: nfs and LBD support (2TB+)
Date: Wed, 01 Dec 2004 18:50:33 -0500	[thread overview]
Message-ID: <1101945033.32266.33.camel@lade.trondhjem.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0412020017550.2774@adsl.a2000.nu>

to den 02.12.2004 Klokka 00:20 (+0100) skreiv Stephan van Hienen:
> Hi,
> 
> i don't know if this is kernel related ?
> 
> server is exporting nfs 2.3TB
> 
> /dev/md0              2.3T  959G  1.4T  41% /raid
> 
> on the client i see this as 316GB :
> 
> storage:/raid         316GB  129GB  187GB  41% /raid
> 
> server is running 2.6.10-rc2
> client is running 2.6.9-ac11
> 
> both have LBD support enabled
> (and both are running tao (which is based on rhel 3))
> 
> any ideas ?

Yep... There is a slight problem with the way glibc has decided to
implement the statvfs function when interacting with 2.6.x kernels...

The POSIX definition of statvfs declares that the entry f_blocks (which
returns the size of the filesystem) shall be in units of f_frsize (see
the manpage).

OTOH the system call sys_statfs() still returns f_blocks in units of
f_bsize (as it has done since the dawn of Linux)...

So when glibc calls sys_statfs(), and then just copies the results into
the statvfs format structure, it is putting a value of f_blocks which is
in units of f_bsize into something that should be in units of f_frsize.

This was not a problem in Linux-2.4.x, 'cos glibc would simply emulate a
value for f_frsize by setting it to f_bsize.
However for 2.6.x kernels, glibc grabs a value of f_frsize that the
kernel gives it. So if that value differs from the bsize (and allowing
f_frsize != f_bsize is the whole point of passing a value for f_frsize
to glibc in the first place), you get wierd discrepancies like the
above.

Cheers,
  Trond

-- 
Trond Myklebust <trond.myklebust@fys.uio.no>


  reply	other threads:[~2004-12-01 23:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-01 23:20 Stephan van Hienen
2004-12-01 23:50 ` Trond Myklebust [this message]
2004-12-02 17:51   ` Stephan van Hienen
2004-12-02 18:08     ` Trond Myklebust
     [not found] ` <20041201234619.GO22547@schnapps.adilger.int>
2004-12-02 17:49   ` Stephan van Hienen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1101945033.32266.33.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=kernel@a2000.nu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®