mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 23:39:18 +00:00
NFS: Fix dcache revalidation bugs
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>
This commit is contained in:
parent
7957c1418f
commit
6ecc5e8fca
10
fs/nfs/dir.c
10
fs/nfs/dir.c
@ -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)
|
static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
|
||||||
{
|
{
|
||||||
unsigned long verf;
|
|
||||||
|
|
||||||
if (IS_ROOT(dentry))
|
if (IS_ROOT(dentry))
|
||||||
return 1;
|
return 1;
|
||||||
verf = dentry->d_time;
|
if (dentry->d_time == NFS_I(dir)->cache_change_attribute)
|
||||||
if (nfs_caches_unstable(dir)
|
return 1;
|
||||||
|| verf != NFS_I(dir)->cache_change_attribute)
|
return 0;
|
||||||
return 0;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
|
static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
|
||||||
|
@ -785,7 +785,6 @@ void nfs_end_data_update(struct inode *inode)
|
|||||||
nfsi->cache_validity |= NFS_INO_INVALID_DATA;
|
nfsi->cache_validity |= NFS_INO_INVALID_DATA;
|
||||||
spin_unlock(&inode->i_lock);
|
spin_unlock(&inode->i_lock);
|
||||||
}
|
}
|
||||||
nfsi->cache_change_attribute = jiffies;
|
|
||||||
atomic_dec(&nfsi->data_updates);
|
atomic_dec(&nfsi->data_updates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user