mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rick Lindsley <ricklind@us.ibm.com>
To: Robert Derr <rderr@weatherflow.com>
Cc: linux-kernel@vger.kernel.org, amitarora@in.ibm.com, suzukikp@in.ibm.com
Subject: Re: 2.6.13.3 Memory leak, names_cache
Date: Thu, 06 Oct 2005 13:03:18 -0700	[thread overview]
Message-ID: <200510062003.j96K3In0016900@owlet.beaverton.ibm.com> (raw)
In-Reply-To: Your message of "Thu, 06 Oct 2005 14:34:25 EDT." <43456E31.8000906@weatherflow.com>

Are you running with CONFIG_AUDITSYSCALL?

We ran into what sounds like the same problem and we're testing
a patch right now for a names_cache growth which only occurs
with CONFIG_AUDITSYSCALL enabled, and then only every time you
traverse a symlink.  In open_namei(), in the do_link section, we call
__do_follow_link() which will bypass the auditing whether it's enabled
or not.  However at the end of this section, we will call putname(),
which will *not* actually do a __putname() if auditing is enabled because
it believes it will happen at syscall return.  So we slowly lose memory
with each link traversal.

The code in open_namei() is a bit non-intuitive in error conditions,
but the general fix appears to be pretty straightforward.  Let me know if
this patch seems to do the trick for you.


--- linux-2.6.13.3/fs/namei.c	2005-08-28 16:41:01.000000000 -0700
+++ linux-2.6.13.3-new/fs/namei.c	2005-10-06 12:45:41.996243768 -0700
@@ -1557,19 +1557,19 @@ do_link:
 	if (nd->last_type != LAST_NORM)
 		goto exit;
 	if (nd->last.name[nd->last.len]) {
-		putname(nd->last.name);
+		__putname(nd->last.name);
 		goto exit;
 	}
 	error = -ELOOP;
 	if (count++==32) {
-		putname(nd->last.name);
+		__putname(nd->last.name);
 		goto exit;
 	}
 	dir = nd->dentry;
 	down(&dir->d_inode->i_sem);
 	path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
 	path.mnt = nd->mnt;
-	putname(nd->last.name);
+	__putname(nd->last.name);
 	goto do_last;
 }
 

  parent reply	other threads:[~2005-10-06 20:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-06 18:34 Robert Derr
2005-10-06 19:03 ` Linus Torvalds
2005-10-06 19:24   ` Robert Derr
2005-10-06 19:54     ` Linus Torvalds
2005-10-06 20:03 ` Rick Lindsley [this message]
2005-10-06 21:17   ` Robert Derr
2005-10-06 21:31   ` Linus Torvalds
2005-10-06 23:31     ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200510062003.j96K3In0016900@owlet.beaverton.ibm.com \
    --to=ricklind@us.ibm.com \
    --cc=amitarora@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rderr@weatherflow.com \
    --cc=suzukikp@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®