aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@fys.uio.no>2005-10-17 06:02:00 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-17 17:47:16 -0400
commitb3c52da33ce95747b1bff86cce716d4f1397f14a (patch)
tree7958a929e5b9486bf0b5358776078c1bc71faf88 /fs/nfs/delegation.c
parent13b58ee51802a45d2b8853ffe0003d9fa768195c (diff)
[PATCH] NFS: Fix cache consistency races
If the data cache has been marked as potentially invalid by nfs_refresh_inode, we should invalidate it rather than assume that changes are due to our own activity. Also ensure that we always start with a valid cache before declaring it to be protected by a delegation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index d7f7eb669d03..4a36839f0bbd 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -85,6 +85,10 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
85 struct nfs_delegation *delegation; 85 struct nfs_delegation *delegation;
86 int status = 0; 86 int status = 0;
87 87
88 /* Ensure we first revalidate the attributes and page cache! */
89 if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR)))
90 __nfs_revalidate_inode(NFS_SERVER(inode), inode);
91
88 delegation = nfs_alloc_delegation(); 92 delegation = nfs_alloc_delegation();
89 if (delegation == NULL) 93 if (delegation == NULL)
90 return -ENOMEM; 94 return -ENOMEM;