浏览代码

NFS: NFS_CACHEINV() should not test for nfs_caches_unstable()

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>
Trond Myklebust 17 年之前
父节点
当前提交
a1643a92f6
共有 2 个文件被更改,包括 1 次插入7 次删除
  1. 1 1
      fs/nfs/dir.c
  2. 0 6
      include/linux/nfs_fs.h

+ 1 - 1
fs/nfs/dir.c

@@ -788,7 +788,7 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
 out_zap_parent:
 out_zap_parent:
 	nfs_zap_caches(dir);
 	nfs_zap_caches(dir);
  out_bad:
  out_bad:
-	NFS_CACHEINV(dir);
+	nfs_mark_for_revalidate(dir);
 	if (inode && S_ISDIR(inode->i_mode)) {
 	if (inode && S_ISDIR(inode->i_mode)) {
 		/* Purge readdir caches. */
 		/* Purge readdir caches. */
 		nfs_zap_caches(inode);
 		nfs_zap_caches(inode);

+ 0 - 6
include/linux/nfs_fs.h

@@ -240,12 +240,6 @@ static inline void nfs_mark_for_revalidate(struct inode *inode)
 	spin_unlock(&inode->i_lock);
 	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)
 static inline int nfs_server_capable(struct inode *inode, int cap)
 {
 {
 	return NFS_SERVER(inode)->caps & cap;
 	return NFS_SERVER(inode)->caps & cap;