lkml.org 
[lkml]   [2013]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/4] de_thread: use change_pid() rather than detach_pid/attach_pid
de_thread() can use change_pid() instead of detach + attach.
This looks better and this ensures that, say, next_thread()
can never see a task with ->pid == NULL.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
fs/exec.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 6430195..00eaba7 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -945,9 +945,8 @@ static int de_thread(struct task_struct *tsk)
* Note: The old leader also uses this pid until release_task
* is called. Odd but simple and correct.
*/
- detach_pid(tsk, PIDTYPE_PID);
tsk->pid = leader->pid;
- attach_pid(tsk, PIDTYPE_PID, task_pid(leader));
+ change_pid(tsk, PIDTYPE_PID, task_pid(leader));
transfer_pid(leader, tsk, PIDTYPE_PGID);
transfer_pid(leader, tsk, PIDTYPE_SID);

--
1.5.5.1


\
 
 \ /
  Last update: 2013-06-09 19:21    [W:0.770 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site