Skip to content

Commit

Permalink
NFS: NFS_CACHEINV() should not test for nfs_caches_unstable()
Browse files Browse the repository at this point in the history
The fact that we're in the process of modifying the inode does not mean
that we should not invalidate the attribute and data caches. The defensive
thing is to always invalidate when we're confronted with inode
mtime/ctime or change_attribute updates that we do not immediately
recognise.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 9, 2007
1 parent 3258b4f commit a1643a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
out_zap_parent:
nfs_zap_caches(dir);
out_bad:
NFS_CACHEINV(dir);
nfs_mark_for_revalidate(dir);
if (inode && S_ISDIR(inode->i_mode)) {
/* Purge readdir caches. */
nfs_zap_caches(inode);
Expand Down
6 changes: 0 additions & 6 deletions include/linux/nfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,6 @@ static inline void nfs_mark_for_revalidate(struct inode *inode)
spin_unlock(&inode->i_lock);
}

static inline void NFS_CACHEINV(struct inode *inode)
{
if (!nfs_caches_unstable(inode))
nfs_mark_for_revalidate(inode);
}

static inline int nfs_server_capable(struct inode *inode, int cap)
{
return NFS_SERVER(inode)->caps & cap;
Expand Down

0 comments on commit a1643a9

Please sign in to comment.