Linux NFS development
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>,
	Ext2 devel <ext2-devel@lists.sourceforge.net>,
	NFS maillist <nfs@lists.sourceforge.net>,
	Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: [Ext2-devel] Re: [NFS] htree+NFS (NFS client bug?)
Date: 28 Nov 2002 12:00:27 -0800	[thread overview]
Message-ID: <1038513627.1464.44.camel@ixodes.goop.org> (raw)
In-Reply-To: <20021128171324.G2362@redhat.com>

On Thu, 2002-11-28 at 09:13, Stephen C. Tweedie wrote:
> In fact, it's not clear what we _can_ return as f_pos after the last
> dirent.
> 
> We're only using 31-bit hashes right now.  Trond, how will other NFS
> clients react if we return an NFS cookie 32-bits wide?  We could
> easily use something like 0x80000000 as an f_pos to represent EOF in
> the Linux side of things, but will that cookie work if passed over the
> wire on NFSv2?
> 
> The alternative is to hack in a special case so that (for example) we
> consider a major htree hash of 0x7fffffff to map to an f_pos of
> 0x7ffffffe and just consider that a possible collision, so that
> 0x7fffffff is a unique EOF for the htree tree walker.

Even if you fix this, there's another problem. 

It seems that htree basically can't work with NFS in its current state -
it only works at all on small directories, which aren't hashed and
therefore use the non-htree cookie scheme.  This can be fixed creating a
distinct EOF cookie.

However, in the transformation from a non-hashed to hashed directory the
cookie scheme completely changes, and in effect invalidates all cookies
currently known by clients.  The obvious problem is that sometimes
adding a single entry to a directory will kill all concurrent readdirs.

I know that changing a directory while scanning it has at least some
undefined effects (allowed to miss entries, but not allowed to
duplicate, if I remember correctly), but if you add a single entry to a
directory, is it allowed to completely break any pending readdir
operation?

One solution I can think of is to always use name hashes as directory
cookies, even for non-hashed directories.  This means that scans of a
small directory will require linear searching to find the entry
corresponding to a particular cookie, but since the directory is small
by definition it shouldn't be a bad performance hit.

	J

  parent reply	other threads:[~2002-11-28 20:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-26 23:44 htree+NFS (NFS client bug?) Jeremy Fitzhardinge
2002-11-27  3:26 ` [NFS] " Trond Myklebust
2002-11-27  2:59   ` [Ext2-devel] " chrisl
2002-11-27  8:58   ` Jeremy Fitzhardinge
2002-11-27 15:00     ` Stephen C. Tweedie
2002-11-27 20:25       ` [Ext2-devel] " Trond Myklebust
2002-11-27 20:55         ` Stephen C. Tweedie
2002-11-27 22:44           ` [Ext2-devel] " Trond Myklebust
2002-11-28 16:41             ` Stephen C. Tweedie
2002-11-28 16:58               ` Trond Myklebust
2002-11-28 17:09                 ` Stephen C. Tweedie
2002-11-28 17:57                   ` Trond Myklebust
2002-11-28 16:44           ` Stephen C. Tweedie
2002-11-28 17:13             ` Stephen C. Tweedie
2002-11-28 17:44               ` Trond Myklebust
2002-11-28 20:00               ` Jeremy Fitzhardinge [this message]
2002-11-28  2:07       ` [Ext2-devel] " Jeremy Fitzhardinge
2002-11-28  2:46         ` Trond Myklebust
2002-11-27 13:33 ` Theodore Ts'o
2002-11-27 20:42   ` Trond Myklebust

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=1038513627.1464.44.camel@ixodes.goop.org \
    --to=jeremy@goop.org \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=sct@redhat.com \
    --cc=trond.myklebust@fys.uio.no \
    /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