summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2014-11-19 08:50:34 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2014-11-19 19:07:20 +0100
commit4a7795d35e252f38298980530e01e21867f8f856 (patch)
tree1ed969cdba05031ff6410a14f32225744b351022
parentFix thinko in iov_iter_single_seg_count (diff)
downloadlinux-4a7795d35e252f38298980530e01e21867f8f856.tar.xz
linux-4a7795d35e252f38298980530e01e21867f8f856.zip
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: Yan, Zheng <zyan@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/dcache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 3ffef7f4e5cd..5bc72b07fde2 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -778,6 +778,7 @@ restart:
struct dentry *parent = lock_parent(dentry);
if (likely(!dentry->d_lockref.count)) {
__dentry_kill(dentry);
+ dput(parent);
goto restart;
}
if (parent)