]> err.no Git - linux-2.6/commitdiff
NFS: Fix dcache revalidation bugs
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 28 Sep 2007 18:20:33 +0000 (14:20 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 9 Oct 2007 21:18:49 +0000 (17:18 -0400)
We don't need to force a dentry lookup just because we're making changes to
the directory.

Don't update nfsi->cache_change_attribute in nfs_end_data_update: that
overrides the NFSv3/v4 weak consistency checking that tells us our update
was the only one, and that tells us the dcache is still valid.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c
fs/nfs/inode.c

index 2b5e611352c54c108dcc44e455cd2672a70ad798..6518b098e625a5872b7417f79ebfb4cd0016d955 100644 (file)
@@ -650,15 +650,11 @@ static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
  */
 static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
 {
-       unsigned long verf;
-
        if (IS_ROOT(dentry))
                return 1;
-       verf = dentry->d_time;
-       if (nfs_caches_unstable(dir)
-                       || verf != NFS_I(dir)->cache_change_attribute)
-               return 0;
-       return 1;
+       if (dentry->d_time == NFS_I(dir)->cache_change_attribute)
+               return 1;
+       return 0;
 }
 
 static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
index ed035a81eea2b6da080b1f7cc7f85a2f56a98e6d..cca1ab2922bfa33572b3dfeeba06dccfbbd7e422 100644 (file)
@@ -785,7 +785,6 @@ void nfs_end_data_update(struct inode *inode)
                nfsi->cache_validity |= NFS_INO_INVALID_DATA;
                spin_unlock(&inode->i_lock);
        }
-       nfsi->cache_change_attribute = jiffies;
        atomic_dec(&nfsi->data_updates);
 }