aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-08-15 12:49:17 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:18:40 -0400
commitf2115dc9877d480392e48e3c83bc8cbb4b418fee (patch)
treedc32f48bd76aaa9e1ae4de8cb8ac8510f9742716 /fs/nfs
parent76b32999dfff6e59252a8af17a5671a4cf3bcf9b (diff)
NFS: Fix over-conservative attribute invalidation in nfs_update_inode()
We should always be declaring the attribute cache as valid after having updated it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/inode.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 45633f9ad85..721e511f8ba 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -978,8 +978,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
978 978
979 /* Are we racing with known updates of the metadata on the server? */ 979 /* Are we racing with known updates of the metadata on the server? */
980 data_stable = nfs_verify_change_attribute(inode, fattr->time_start); 980 data_stable = nfs_verify_change_attribute(inode, fattr->time_start);
981 if (data_stable) 981 nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ATIME
982 nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATIME); 982 | NFS_INO_REVAL_PAGECACHE);
983 983
984 /* Do atomic weak cache consistency updates */ 984 /* Do atomic weak cache consistency updates */
985 nfs_wcc_update_inode(inode, fattr); 985 nfs_wcc_update_inode(inode, fattr);
@@ -1060,12 +1060,11 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
1060 nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode); 1060 nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode);
1061 nfsi->attrtimeo_timestamp = now; 1061 nfsi->attrtimeo_timestamp = now;
1062 } 1062 }
1063 invalid &= ~NFS_INO_INVALID_ATTR;
1063 /* Don't invalidate the data if we were to blame */ 1064 /* Don't invalidate the data if we were to blame */
1064 if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) 1065 if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)
1065 || S_ISLNK(inode->i_mode))) 1066 || S_ISLNK(inode->i_mode)))
1066 invalid &= ~NFS_INO_INVALID_DATA; 1067 invalid &= ~NFS_INO_INVALID_DATA;
1067 if (data_stable)
1068 invalid &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME|NFS_INO_REVAL_PAGECACHE);
1069 if (!nfs_have_delegation(inode, FMODE_READ) || 1068 if (!nfs_have_delegation(inode, FMODE_READ) ||
1070 (nfsi->cache_validity & NFS_INO_REVAL_FORCED)) 1069 (nfsi->cache_validity & NFS_INO_REVAL_FORCED))
1071 nfsi->cache_validity |= invalid; 1070 nfsi->cache_validity |= invalid;