summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-09-23 23:28:42 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-10-07 23:41:17 +0200
commit4dc05efb86239321d43a9d74fd2ecd5c21bfc2ad (patch)
tree3075ff7f73fd2cd85d2fcf055ec201e9ffac1cff /fs/nfs
parentNFS: Fix nfs_post_op_update_inode_force_wcc() (diff)
downloadlinux-4dc05efb86239321d43a9d74fd2ecd5c21bfc2ad.tar.xz
linux-4dc05efb86239321d43a9d74fd2ecd5c21bfc2ad.zip
NFS: Convert __nfs_revalidate_inode() to use nfs_refresh_inode()
In the case where there are parallel RPC calls to the same inode, we may receive stale metadata due to the lack of ordering, hence the sanity checking of metadata in nfs_refresh_inode(). Currently, __nfs_revalidate_inode() is calling nfs_update_inode() directly, without any further sanity checks, and hence may end up setting the inode up with stale metadata. Fix is to use nfs_refresh_inode() instead of nfs_update_inode(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/inode.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 610d022fc7a5..697157c1fdd1 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -724,16 +724,13 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
goto out;
}
- spin_lock(&inode->i_lock);
- status = nfs_update_inode(inode, &fattr);
+ status = nfs_refresh_inode(inode, &fattr);
if (status) {
- spin_unlock(&inode->i_lock);
dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Ld) refresh failed, error=%d\n",
inode->i_sb->s_id,
(long long)NFS_FILEID(inode), status);
goto out;
}
- spin_unlock(&inode->i_lock);
if (nfsi->cache_validity & NFS_INO_INVALID_ACL)
nfs_zap_acl_cache(inode);