提交 d9e80b7d 编写于 作者: A Al Viro 提交者: Linus Torvalds

nfs d_revalidate() is too trigger-happy with d_drop()

If dentry found stale happens to be a root of disconnected tree, we
can't d_drop() it; its d_hash is actually part of s_anon and d_drop()
would simply hide it from shrink_dcache_for_umount(), leading to
all sorts of fun, including busy inodes on umount and oopsen after
that.

Bug had been there since at least 2006 (commit c636eb already has it),
so it's definitely -stable fodder.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Cc: stable@kernel.org
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1d16b0f2
...@@ -837,6 +837,8 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) ...@@ -837,6 +837,8 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
/* If we have submounts, don't unhash ! */ /* If we have submounts, don't unhash ! */
if (have_submounts(dentry)) if (have_submounts(dentry))
goto out_valid; goto out_valid;
if (dentry->d_flags & DCACHE_DISCONNECTED)
goto out_valid;
shrink_dcache_parent(dentry); shrink_dcache_parent(dentry);
} }
d_drop(dentry); d_drop(dentry);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册