linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Malahal Naineni <malahal@us.ibm.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: State of NFSv4 VolatileFilehandles
Date: Wed, 17 Aug 2011 08:24:17 +1000	[thread overview]
Message-ID: <20110817082417.66e2758a@notabene.brown> (raw)
In-Reply-To: <20110816155939.GA15566@us.ibm.com>

On Tue, 16 Aug 2011 08:59:39 -0700 Malahal Naineni <malahal@us.ibm.com> wrote:

> Trond Myklebust [Trond.Myklebust@netapp.com] wrote:
> > On Mon, 2011-08-15 at 13:49 -0700, Malahal Naineni wrote: 
> > > NeilBrown [neilb@suse.de] wrote:
> > > > > POSIX allows the namespace to change at any time (rename() or unlink())
> > > > > and so you cannot rely on addressing files by pathname. That was the
> > > > > whole reason for introducing filehandles into NFSv2 in the first place.
> > > > > 
> > > > > Volatile filehandles were introduced in NFSv4 without any attempt to fix
> > > > > those shortcomings. There is no real prescription for how to recover in
> > > > > a situation where a rename or unlink has occurred prior to the
> > > > > filehandle expiring. Nor is there a reliable prescription for dealing
> > > > > with the case where a new file of the same name has replaced the
> > > > > original.
> > > > > Basically, the implication is that volatile filehandles are only really
> > > > > usable in a situation where the whole Filesystem is read-only on the
> > > > > server.
> > > > 
> > > > I substantially agree, though I think the implication can be refined a little.
> > > > 
> > > > I would say that the implication is that a VFH is only really usable when the
> > > > complete path leading to the file in question is read-only.   We don't need
> > > > to assume that other files in other parts of the hierarchy which have stable
> > > > file handles are read-only.
> > > 
> > > The spec recommends "change" attribute for validating data cache, name
> > > cache, etc.  Some client implementations use "change" attribute for
> > > validating VFH though! Can we use it for validating VFH?
> > 
> > The change attribute can only be used as a heuristic since it is not
> > guaranteed to be a value that is unique to one file.
> 
> Agreed, it is a heuristic if we only use the file's "change id". If we
> want to be very strict, we could potentially use change ids of all the
> path components in the pathname... OR how about a mount option "use VFH
> at your own risk"?

I don't think change-id is really useful even as an heuristic.  Not only are
they not unique, but they are not guaranteed to be stable either (after all,
something might have changed when the file handle expired).

I think the *only* credible response to FHEXPIRED is to re-lookup the same
name and as the spec doesn't make any promises about that it is *only* safe
to do it with explicit permission through a mount option.

NeilBrown

  reply	other threads:[~2011-08-16 22:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 11:58 State of NFSv4 VolatileFilehandles Venkateswararao Jujjuri
2011-08-02 14:53 ` Chuck Lever
2011-08-03  7:28   ` Venkateswararao Jujjuri
2011-08-03 12:27     ` Myklebust, Trond
2011-08-03 22:23       ` NeilBrown
2011-08-04  1:16         ` Malahal Naineni
2011-08-04  2:12           ` Trond Myklebust
2011-08-15 20:49         ` Malahal Naineni
2011-08-16  8:06           ` Trond Myklebust
2011-08-16 15:59             ` Malahal Naineni
2011-08-16 22:24               ` NeilBrown [this message]
2011-08-03 15:43     ` Malahal Naineni
2011-08-03 22:13     ` Chuck Lever
2011-08-04 11:27       ` Venkateswararao Jujjuri
2011-08-04 16:03         ` J. Bruce Fields
2011-08-04 16:10           ` Trond Myklebust
2011-08-04 16:27             ` J. Bruce Fields
2011-08-04 16:48               ` Myklebust, Trond
2011-08-04 17:03                 ` J. Bruce Fields
2011-08-04 17:21                   ` Trond Myklebust
2011-08-04 17:30                     ` J. Bruce Fields
2011-08-04 17:38                       ` Trond Myklebust
2011-08-05 13:38           ` Christoph Hellwig
2011-08-05 19:16             ` J. Bruce Fields
2011-08-10 10:24               ` Christoph Hellwig
2011-08-04 15:56     ` J. Bruce Fields

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=20110817082417.66e2758a@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-nfs@vger.kernel.org \
    --cc=malahal@us.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).