lkml.org 
[lkml]   [2006]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-22 11:37    [W:0.036 / U:0.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site