Re: State of NFSv4 VolatileFilehandles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 16 Aug 2011 08:59:39 -0700 Malahal Naineni <malahal@xxxxxxxxxx> wrote:

> Trond Myklebust [Trond.Myklebust@xxxxxxxxxx] wrote:
> > On Mon, 2011-08-15 at 13:49 -0700, Malahal Naineni wrote: 
> > > NeilBrown [neilb@xxxxxxx] 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
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux