aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-09 09:34:19 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-09 09:34:19 -0400
commit55a975937d40cac582e981ddc8ed783b3dcc043c (patch)
tree13507eaebdab5e9c9dd615fe373ec6c0ddcbade4 /fs/nfs/dir.c
parent8b4bdcf8995dd92b23d2ec22b32aee8fbbb50e1c (diff)
NFS: Ensure the client submounts, when it crosses a server mountpoint.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 1d3d8922a663..3ddda6f7ecc2 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -868,6 +868,17 @@ int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd)
868 return (nd->intent.open.flags & O_EXCL) != 0; 868 return (nd->intent.open.flags & O_EXCL) != 0;
869} 869}
870 870
871static inline int nfs_reval_fsid(struct inode *dir,
872 struct nfs_fh *fh, struct nfs_fattr *fattr)
873{
874 struct nfs_server *server = NFS_SERVER(dir);
875
876 if (!nfs_fsid_equal(&server->fsid, &fattr->fsid))
877 /* Revalidate fsid on root dir */
878 return __nfs_revalidate_inode(server, dir->i_sb->s_root->d_inode);
879 return 0;
880}
881
871static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd) 882static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
872{ 883{
873 struct dentry *res; 884 struct dentry *res;
@@ -900,6 +911,11 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
900 res = ERR_PTR(error); 911 res = ERR_PTR(error);
901 goto out_unlock; 912 goto out_unlock;
902 } 913 }
914 error = nfs_reval_fsid(dir, &fhandle, &fattr);
915 if (error < 0) {
916 res = ERR_PTR(error);
917 goto out_unlock;
918 }
903 inode = nfs_fhget(dentry->d_sb, &fhandle, &fattr); 919 inode = nfs_fhget(dentry->d_sb, &fhandle, &fattr);
904 res = (struct dentry *)inode; 920 res = (struct dentry *)inode;
905 if (IS_ERR(res)) 921 if (IS_ERR(res))