[patch 43/45] struct file leakage

From: Greg KH
Date: Mon Jul 17 2006 - 12:42:48 EST

-stable review patch. If anyone has any objections, please let us know.

From: Kirill Korotaev <dev@xxxxx>

2.6.16 leaks like hell. While testing, I found massive leakage
(reproduced in openvz) in:


And 1 object leaks in

It is the fix for the first one. filp leaks in the bowels of namei.c.

Seems, size-4096 is file table leaking in expand_fdtables.

I have no idea what are the rest and why they show only accompanying
another leaks. Some debugging structs?

[akpm@xxxxxxxx, Trond: remove the IS_ERR() check]
Signed-off-by: Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx>
Cc: Kirill Korotaev <dev@xxxxxxxxxx>
Cc: Trond Myklebust <trond.myklebust@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

fs/namei.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

--- linux-
+++ linux-
@@ -1712,8 +1712,14 @@ do_link:
if (error)
goto exit_dput;
error = __do_follow_link(&path, nd);
- if (error)
+ if (error) {
+ /* Does someone understand code flow here? Or it is only
+ * me so stupid? Anathema to whoever designed this non-sense
+ * with "intent.open".
+ */
+ release_open_intent(nd);
return error;
+ }
nd->flags &= ~LOOKUP_PARENT;
if (nd->last_type == LAST_BIND)
goto ok;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/