vfs: fix reference leak in d_prune_aliases()
PATCH 1/1 vfs: fix reference leak in d_prune_aliases()
Signed-off-by Yan, Zheng <[email protected]>
--- fs/dcache.c | 1 + 1 file changed, 1 insertion(+)
fs/dcache.c +1 -0
@@ -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)
Signature · 1 line
1.9.3
Al Viro
maintainerQuoted 10 lines · Zheng
Signed-off-by Yan, Zheng <[email protected]>--- fs/dcache.c | 1 + 1 file changed, 1 insertion(+)fs/dcache.c +0
-0
fs/dcache.c restart: · line 784
Quoted 7 lines
fs/dcache.c +1
-0@@ -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)
Good catch... Applied, will push to Linus. I'm putting the following as commit message:
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.
Is the above OK with you?