From 26c0273b7f4b1510eec4f0f92d19971dc0c2fd67 Mon Sep 17 00:00:00 2001 From: Kirill Korotaev Date: Wed, 30 Aug 2006 22:55:59 +0200 Subject: fix struct file leakage 2.6.16 leaks like hell. While testing, I found massive filp leakage (reproduced in openvz) in the bowels of namei.c. Signed-off-by: Alexey Kuznetsov Signed-off-by: Adrian Bunk --- fs/namei.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index f11c0aa2293..3ece3a93dd9 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1708,8 +1708,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; -- cgit v1.2.3-18-g5258