On Wednesday September 27, [EMAIL PROTECTED] wrote:
> Neil Brown writes:
> > NFS does all accesses using a filehandle, which is essentially a
> > pointer to an inode. By the time you get the the bit of code where
> > you have inserted a patch, it is the inode that we are really sure of,
> > and the dentry is just there as a handle to hold the inode, because
> > Linux/VFS perfers dentrys to inodes. At this point, revalidating the
> > dentry seems a bit pointless.
>
> It's not so much that you are revalidating the dentry itself, it's
> rather that you are checking with the filesystem to see if any of
> the data in the inode has been changed. Since it is possible that
> the inode was changed on/by another host (if the filesystem is not
> a local filesystem) we need to update the local inode before we send
> out again information about it.
>
> > What particular non-local filesystem are you trying to access via NFS?
>
> It actually could be any number of distributed filesystems - InterMezzo,
> GFS, etc, maybe its even a local filesystem that has HFS support and
> you need to revalidate to ensure the file is still in on-line storage.
> The point is that NFS needs to check with the filesystem first (if needed).
> That's why i_op->revalidate exists (and is optional) in the first place.
>
I've thought a bit more about NFS exporting non-local filesystems, and
there are quite a few issues that you would need to address before
worring about needing to revalidate the inode.
Firstly, an NFS filehandle contains an identifier of the filesystem
and an identifier of the file, which is typically an inode number and
a generation number to verify that the inode number hasn't been
reused.
The filesystem identifier currently is the device number of the device
that the filesystem is on, which can only work for filesystems that
live on devices - not true for non-local filesystems. There could
certainly be other ways to identify a filesystem. I am kind of
partial to the idea of declaring a id in the /etc/exports file, and
using that. This could work equally for non-local filesystems, but
needs quite a few changes.
Secondly, when a filehandle arrives in an NFS request, it needs to be
mapped to an inode. This is currently done by abusing iget (which is
meant be an internal interface for the filesystem to use).
iget depending on i_op->read_inode and most network filesystems (NFS
and coda at least) provide a read_inode that just initialises the
inode and doesn't actually read anything, and so is useless to nfsd.
I have a patch on the way (it is taking a while to get through the
quality assurance process) which provides a better interface between
knfsd and the filesystem.
You can see it (against 2.4.0-test9pre6) at
http://www.cse.unsw.edu.au/~neilb/oss/knfsd/patch-2.4.0-test9p6
This essentially allows a filesystem to provide a file-handle to inode
mapping function. For a non-local filesystem, it would make most
sense to have this function check the currency of the inode, rather
than calling revalidate separately.
Does that make sense?
> > And re-exporting NFS is explicitly a no-no (though I cannot remember
> > where I read that).
>
> Actually, I seem to recall that there exist NFS->NFS repeaters already
> (probably on Solaris). The reason for NFS exporting a cluster filesystem
> are many - NFS clients are available for lots of platforms, some cluster
> filesystems only work well tightly coupled, you want an HA NFS server,
> you want an incrementally scalable NFS server, or some combination
> of these.
Fair enough. Possibly it could work.
For the last two, I would think that a clever client with failover and
an automounter would be better, but possibly it could be done
server-side.
NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]