[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20060822183820.b62d44bd.kamezawa.hiroyu@jp.fujitsu.com>
Date: Tue, 22 Aug 2006 18:38:20 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: linux-kernel@...r.kernel.org, akpm@...l.org, ebiederm@...ssion.com,
pj@....com, saito.tadashi@...t.fujitsu.com
Subject: Re: [RFC][PATCH] ps command race fix take2 [4/4] proc_pid_readdir
sorry, this rcu_read_lock() should be inserted.
-Kame
fs/proc/base.c | 2 ++
1 files changed, 2 insertions(+)
Index: linux-2.6.18-rc4/fs/proc/base.c
===================================================================
--- linux-2.6.18-rc4.orig/fs/proc/base.c
+++ linux-2.6.18-rc4/fs/proc/base.c
@@ -2240,12 +2240,14 @@ retry:
* insertion of token should be done just before not-stale task.
*/
if (task) {
+ rcu_read_lock();
pos = first_alive_task(task);
if (pos != task) { /* task is not alive */
if (pos)
get_task_struct(pos);
put_task_struct(task);
}
+ rcu_read_unlock();
if (pos) { /* remember here for next access */
/* token->token turns to be 1 */
insert_list_token_rcu(token, &pos->tasks);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists