Re: [PATCH] proc: readdir race fix.
- From: ebiederm@xxxxxxxxxxxx (Eric W. Biederman)
- Date: Mon, 04 Sep 2006 20:54:30 -0600
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> writes:
On Mon, 04 Sep 2006 17:13:10 -0600
ebiederm@xxxxxxxxxxxx (Eric W. Biederman) wrote:
Hi, Hit OOM-Killer, because of memory leak of task struct.
patch is attached.
-Kame
task struct should be put always.
Good catch. I actually have a pending cleanup that works better if the
task struct is held across the filldir so the incremental patch should look like:
I also noticed a benign typo in TGID_OFFSET (1 subtract one that I shouldn't)
Complete patch in just a moment.
Eric
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b7650b9..03f6680 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2186,7 +2186,7 @@ int proc_pid_readdir(struct file * filp,
tgid = filp->f_pos - TGID_OFFSET;
for (task = next_tgid(tgid);
task;
- task = next_tgid(tgid + 1)) {
+ put_task_struct(task), task = next_tgid(tgid + 1)) {
int len;
ino_t ino;
tgid = task->pid;
-
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/
- References:
- [PATCH] proc: readdir race fix.
- From: Eric W. Biederman
- Re: [PATCH] proc: readdir race fix.
- From: KAMEZAWA Hiroyuki
- [PATCH] proc: readdir race fix.
- Prev by Date: Re: [PATCH] proc: readdir race fix.
- Next by Date: Re: [PATCH 0/7] Permit filesystem local caching and NFS superblock sharing [try #13]
- Previous by thread: Re: [PATCH] proc: readdir race fix.
- Next by thread: [PATCH] proc: readdir race fix
- Index(es):
Relevant Pages
|
|