Skip to content

Commit

Permalink
NFS: Fix dcache revalidation bugs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 9, 2007
1 parent 7957c14 commit 6ecc5e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 6ecc5e8

Please sign in to comment.