aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-09-29 17:15:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:19:20 -0400
commit4b841736bc16b320bcdb1e8ece585b3ced9a8811 (patch)
treec79e4c99393b8ebfd54617f0ffa791dacc443cb5
parent8edb01828837302055a8f0afddb2256659480bc5 (diff)
NFS: Fix nfs_verify_change_attribute()
We don't care about whether or not some other process on our client is changing the directory while we're in nfs_lookup_revalidate(), because the dcache will take care of ensuring local atomicity. We can therefore remove the test for nfs_caches_unstable(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/dir.c2
-rw-r--r--include/linux/nfs_fs.h14
2 files changed, 8 insertions, 8 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 07df192e23a0..e275a6eb0a7c 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -646,7 +646,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
646{ 646{
647 if (IS_ROOT(dentry)) 647 if (IS_ROOT(dentry))
648 return 1; 648 return 1;
649 if (dentry->d_time == NFS_I(dir)->cache_change_attribute) 649 if (nfs_verify_change_attribute(dir, dentry->d_time))
650 return 1; 650 return 1;
651 return 0; 651 return 0;
652} 652}
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index a765dd456922..0197b1243fe0 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -270,16 +270,16 @@ static inline unsigned long nfs_save_change_attribute(struct inode *dir)
270} 270}
271 271
272/** 272/**
273 * nfs_verify_change_attribute - Detects NFS inode cache updates 273 * nfs_verify_change_attribute - Detects NFS remote directory changes
274 * @inode - pointer to inode 274 * @dir - pointer to parent directory inode
275 * @chattr - previously saved change attribute 275 * @chattr - previously saved change attribute
276 * Return "false" if metadata has been updated (or is in the process of 276 * Return "false" if the verifiers doesn't match the change attribute.
277 * being updated) since the change attribute was saved. 277 * This would usually indicate that the directory contents have changed on
278 * the server, and that any dentries need revalidating.
278 */ 279 */
279static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) 280static inline int nfs_verify_change_attribute(struct inode *dir, unsigned long chattr)
280{ 281{
281 return !nfs_caches_unstable(inode) 282 return chattr == NFS_I(dir)->cache_change_attribute;
282 && chattr == NFS_I(inode)->cache_change_attribute;
283} 283}
284 284
285/* 285/*