NFS: Fix nfs_verify_change_attribute()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 29 Sep 2007 21:15:01 +0000 (17:15 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 9 Oct 2007 21:19:20 +0000 (17:19 -0400)
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>
fs/nfs/dir.c
include/linux/nfs_fs.h

index 07df192e23a090ea6fd9b21b61d5e4ffd0c77857..e275a6eb0a7c06414bfff4f813cf1b070b8f2fd3 100644 (file)
@@ -646,7 +646,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
 {
        if (IS_ROOT(dentry))
                return 1;
-       if (dentry->d_time == NFS_I(dir)->cache_change_attribute)
+       if (nfs_verify_change_attribute(dir, dentry->d_time))
                return 1;
        return 0;
 }
index a765dd45692277061fe3a8a32fbc2372e0c6d80b..0197b1243fe0af5ec6d0bfc544312f469242b75d 100644 (file)
@@ -270,16 +270,16 @@ static inline unsigned long nfs_save_change_attribute(struct inode *dir)
 }
 
 /**
- * nfs_verify_change_attribute - Detects NFS inode cache updates
- * @inode - pointer to inode
+ * nfs_verify_change_attribute - Detects NFS remote directory changes
+ * @dir - pointer to parent directory inode
  * @chattr - previously saved change attribute
- * Return "false" if metadata has been updated (or is in the process of
- * being updated) since the change attribute was saved.
+ * Return "false" if the verifiers doesn't match the change attribute.
+ * This would usually indicate that the directory contents have changed on
+ * the server, and that any dentries need revalidating.
  */
-static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr)
+static inline int nfs_verify_change_attribute(struct inode *dir, unsigned long chattr)
 {
-       return !nfs_caches_unstable(inode)
-               && chattr == NFS_I(inode)->cache_change_attribute;
+       return chattr == NFS_I(dir)->cache_change_attribute;
 }
 
 /*
This page took 0.029519 seconds and 5 git commands to generate.