You need to sign in or sign up before continuing.
提交 9c7ae043 编写于 作者: T Trond Myklebust 提交者: Yang Yingliang

NFS: Don't gratuitously clear the inode cache when lookup failed

mainline inclusion
from mainline-v5.12-rc3
commit 47397915
category: bugfix
bugzilla: NA
CVE: NA

--------------------------------

The fact that the lookup revalidation failed, does not mean that the
inode contents have changed.

Fixes: 5ceb9d7f ("NFS: Refactor nfs_lookup_revalidate()")
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 347702e3
...@@ -1115,18 +1115,14 @@ nfs_lookup_revalidate_done(struct inode *dir, struct dentry *dentry, ...@@ -1115,18 +1115,14 @@ nfs_lookup_revalidate_done(struct inode *dir, struct dentry *dentry,
__func__, dentry); __func__, dentry);
return 1; return 1;
case 0: case 0:
if (inode && S_ISDIR(inode->i_mode)) { /*
/* Purge readdir caches. */ * We can't d_drop the root of a disconnected tree:
nfs_zap_caches(inode); * its d_hash is on the s_anon list and d_drop() would hide
/* * it from shrink_dcache_for_unmount(), leading to busy
* We can't d_drop the root of a disconnected tree: * inodes on unmount and further oopses.
* its d_hash is on the s_anon list and d_drop() would hide */
* it from shrink_dcache_for_unmount(), leading to busy if (inode && IS_ROOT(dentry))
* inodes on unmount and further oopses. return 1;
*/
if (IS_ROOT(dentry))
return 1;
}
dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n", dfprintk(LOOKUPCACHE, "NFS: %s(%pd2) is invalid\n",
__func__, dentry); __func__, dentry);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册