aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index cae74dd4c7f5..3ddda6f7ecc2 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -528,7 +528,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
528 528
529 lock_kernel(); 529 lock_kernel();
530 530
531 res = nfs_revalidate_inode(NFS_SERVER(inode), inode); 531 res = nfs_revalidate_mapping(inode, filp->f_mapping);
532 if (res < 0) { 532 if (res < 0) {
533 unlock_kernel(); 533 unlock_kernel();
534 return res; 534 return res;
@@ -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))