diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-06-05 13:26:15 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-10 23:40:24 -0400 |
commit | a0356862bcbeb20acf64bc1a82d28a4c5bb957a7 (patch) | |
tree | 20dd38a076a17c35e63eadddc77ccf0f3633f377 /fs/nfs | |
parent | b39e625b6e75aa70e26c13f9378756bb5f2af032 (diff) |
NFS: Fix nfs_reval_fsid()
We don't need to revalidate the fsid on the root directory. It suffices to
revalidate it on the current directory.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 9 | ||||
-rw-r--r-- | fs/nfs/inode.c | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 4948ec1dd9bd..c02a7962e69d 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -897,14 +897,13 @@ int nfs_is_exclusive_create(struct inode *dir, struct nameidata *nd) | |||
897 | return (nd->intent.open.flags & O_EXCL) != 0; | 897 | return (nd->intent.open.flags & O_EXCL) != 0; |
898 | } | 898 | } |
899 | 899 | ||
900 | static inline int nfs_reval_fsid(struct vfsmount *mnt, struct inode *dir, | 900 | static inline int nfs_reval_fsid(struct inode *dir, const struct nfs_fattr *fattr) |
901 | struct nfs_fh *fh, struct nfs_fattr *fattr) | ||
902 | { | 901 | { |
903 | struct nfs_server *server = NFS_SERVER(dir); | 902 | struct nfs_server *server = NFS_SERVER(dir); |
904 | 903 | ||
905 | if (!nfs_fsid_equal(&server->fsid, &fattr->fsid)) | 904 | if (!nfs_fsid_equal(&server->fsid, &fattr->fsid)) |
906 | /* Revalidate fsid on root dir */ | 905 | /* Revalidate fsid using the parent directory */ |
907 | return __nfs_revalidate_inode(server, mnt->mnt_root->d_inode); | 906 | return __nfs_revalidate_inode(server, dir); |
908 | return 0; | 907 | return 0; |
909 | } | 908 | } |
910 | 909 | ||
@@ -946,7 +945,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru | |||
946 | res = ERR_PTR(error); | 945 | res = ERR_PTR(error); |
947 | goto out_unlock; | 946 | goto out_unlock; |
948 | } | 947 | } |
949 | error = nfs_reval_fsid(nd->mnt, dir, &fhandle, &fattr); | 948 | error = nfs_reval_fsid(dir, &fattr); |
950 | if (error < 0) { | 949 | if (error < 0) { |
951 | res = ERR_PTR(error); | 950 | res = ERR_PTR(error); |
952 | goto out_unlock; | 951 | goto out_unlock; |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 23ecf0334a18..7bcb3dfa6179 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -961,8 +961,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
961 | goto out_changed; | 961 | goto out_changed; |
962 | 962 | ||
963 | server = NFS_SERVER(inode); | 963 | server = NFS_SERVER(inode); |
964 | /* Update the fsid if and only if this is the root directory */ | 964 | /* Update the fsid? */ |
965 | if (inode == inode->i_sb->s_root->d_inode | 965 | if (S_ISDIR(inode->i_mode) |
966 | && !nfs_fsid_equal(&server->fsid, &fattr->fsid)) | 966 | && !nfs_fsid_equal(&server->fsid, &fattr->fsid)) |
967 | server->fsid = fattr->fsid; | 967 | server->fsid = fattr->fsid; |
968 | 968 | ||