提交 297bd42b 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

move daemonized kernel threads into the swapper's session

Daemonized kernel threads run in the init's session. This doesn't match the
behaviour of kthread_create()'ed threads, and this is one of the 2 reasons
why we need a special hack in sys_setsid().

Now that set_special_pids() was changed to use struct pid, not pid_t, we can
use init_struct_pid and set 0,0 special pids.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Acked-by: N"Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 8520d7c7
...@@ -388,7 +388,7 @@ void daemonize(const char *name, ...) ...@@ -388,7 +388,7 @@ void daemonize(const char *name, ...)
get_nsproxy(&init_nsproxy); get_nsproxy(&init_nsproxy);
switch_task_namespaces(current, &init_nsproxy); switch_task_namespaces(current, &init_nsproxy);
} }
set_special_pids(find_pid(1)); set_special_pids(&init_struct_pid);
proc_clear_tty(current); proc_clear_tty(current);
/* Block and flush all signals */ /* Block and flush all signals */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册