提交 4a7795d3 编写于 作者: Y Yan, Zheng 提交者: Al Viro

vfs: fix reference leak in d_prune_aliases()

In "d_prune_alias(): just lock the parent and call __dentry_kill()" the old
dget + d_drop + dput has been replaced with lock_parent + __dentry_kill;
unfortunately, dput() does more than just killing dentry - it also drops the
reference to parent.  New variant leaks that reference and needs dput(parent)
after killing the child off.
Signed-off-by: NYan, Zheng <zyan@redhat.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 ad0eab92
......@@ -778,6 +778,7 @@ void d_prune_aliases(struct inode *inode)
struct dentry *parent = lock_parent(dentry);
if (likely(!dentry->d_lockref.count)) {
__dentry_kill(dentry);
dput(parent);
goto restart;
}
if (parent)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册