diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-05-25 01:40:57 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-09 09:34:09 -0400 |
commit | 38478b24e37587f1c4fedf8ac070ca54f052ed28 (patch) | |
tree | da4d900a8bfe27f1243fb0e037b51fae2a7e3256 | |
parent | f1bb0b92ba2cdfffe6e437f7a7da53138cf08d52 (diff) |
NFS: More page cache revalidation fixups
Whenever the directory changes, we want to make sure that we always
invalidate its page cache. Fix up update_changeattr() and
nfs_mark_for_revalidate() so that they do so.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 10 | ||||
-rw-r--r-- | include/linux/nfs_fs.h | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index e38a84874492..ef4c6cccf958 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -185,15 +185,15 @@ static void renew_lease(const struct nfs_server *server, unsigned long timestamp | |||
185 | spin_unlock(&clp->cl_lock); | 185 | spin_unlock(&clp->cl_lock); |
186 | } | 186 | } |
187 | 187 | ||
188 | static void update_changeattr(struct inode *inode, struct nfs4_change_info *cinfo) | 188 | static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo) |
189 | { | 189 | { |
190 | struct nfs_inode *nfsi = NFS_I(inode); | 190 | struct nfs_inode *nfsi = NFS_I(dir); |
191 | 191 | ||
192 | spin_lock(&inode->i_lock); | 192 | spin_lock(&dir->i_lock); |
193 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; | 193 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA; |
194 | if (cinfo->before == nfsi->change_attr && cinfo->atomic) | 194 | if (cinfo->before == nfsi->change_attr && cinfo->atomic) |
195 | nfsi->change_attr = cinfo->after; | 195 | nfsi->change_attr = cinfo->after; |
196 | spin_unlock(&inode->i_lock); | 196 | spin_unlock(&dir->i_lock); |
197 | } | 197 | } |
198 | 198 | ||
199 | struct nfs4_opendata { | 199 | struct nfs4_opendata { |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index c71227dd4389..1d81e7d82970 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -234,8 +234,12 @@ static inline int nfs_caches_unstable(struct inode *inode) | |||
234 | 234 | ||
235 | static inline void nfs_mark_for_revalidate(struct inode *inode) | 235 | static inline void nfs_mark_for_revalidate(struct inode *inode) |
236 | { | 236 | { |
237 | struct nfs_inode *nfsi = NFS_I(inode); | ||
238 | |||
237 | spin_lock(&inode->i_lock); | 239 | spin_lock(&inode->i_lock); |
238 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | 240 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS; |
241 | if (S_ISDIR(inode->i_mode)) | ||
242 | nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_DATA; | ||
239 | spin_unlock(&inode->i_lock); | 243 | spin_unlock(&inode->i_lock); |
240 | } | 244 | } |
241 | 245 | ||