public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Leon Bottou <leonb@research.att.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Subtle NFS/VFS/GLIBC interaction bug
Date: 12 Mar 2001 15:45:27 +0100	[thread overview]
Message-ID: <shsr903jbaw.fsf@charged.uio.no> (raw)
In-Reply-To: <3AA7EC55.E0020B8E@research.att.com>
In-Reply-To: Leon Bottou's message of "Thu, 08 Mar 2001 15:32:21 -0500"

>>>>> " " == Leon Bottou <leonb@research.att.com> writes:

     > Note the strange numbers in the d_off fields.  These are in
     > fact cookies used internally by nfs.  Under nfs2, these are 32
     > bit unsigned number, sign extended to 64 bits.

     > The last cookie has not been properly sign extended.  The
     > glibc-2.2.2 source code for readdir uses __NR_getdents64 and
     > converts the result into 32 bit dirents.  But it sees that the
     > last d_ino cannot fit in an off_t and it simply bails out.

     > There is already a problem in the making since nfs3 cookies are
     > 64 bits long.  But things should work with nfs2.

This is why I wish glibc would drop the whole idea of relying on
seekdir/telldir existing. The LFS does in fact not specify any
equivalent seekdir64/telldir64, and most implementations of *NIX don't
support them.
Currently, the VFS only allows us to support the minimum
implementation which is required to support the 32-bit interface.

     > I can fix the problem using the following hack:

I've got a more complete one. See the 'IRIX' patch on

  http://www.fys.uio.no/~trondmy/src/2.4.2/linux-2.4.2-dir.dif

That patch also sign-extends 32-bit cookies at the NFS level, so that
we can
  a) convert cookies back so that the server accepts them
  b) match sign-extended 32-bit cookies in the page cache

     > That is acceptable as long as filldir_t does not handle 64bits
     > offsets anyway.

     > But it won't last.

Yes and no. All NFSv3 implementations are supposed to support 32-bit
client implementations. All you lose here is the ability to handle
multi-Gigabyte directories.

Cheers,
  Trond

      reply	other threads:[~2001-03-12 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-08 20:32 Subtle NFS/VFS/GLIBC interaction bug Leon Bottou
2001-03-12 14:45 ` Trond Myklebust [this message]

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=shsr903jbaw.fsf@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=leonb@research.att.com \
    --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