diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-03-28 19:11:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 21:36:42 -0500 |
commit | 6b3934ef52712ece50605dfc72e55d00c580831a (patch) | |
tree | 5ec3c4f69a20880f75de6ff8d7d2f67d96328df3 /include | |
parent | 7001510d0cbf51ad202dd2d0744f54104285cbb9 (diff) |
[PATCH] copy_process: cleanup bad_fork_cleanup_signal
__exit_signal() does important cleanups atomically under ->siglock. It is
also called from copy_process's error path. This is not good, for example we
can't move __unhash_process() under ->siglock for that reason.
We should not mix these 2 paths, just look at ugly 'if (p->sighand)' under
'bad_fork_cleanup_sighand:' label. For copy_process() case it is sufficient
to just backout copy_signal(), nothing more.
Again, nobody can see this task yet. For CLONE_THREAD case we just decrement
signal->count, otherwise nobody can see this ->signal and we can free it
lockless.
This patch assumes it is safe to do exit_thread_group_keys() without
tasklist_lock.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | include/linux/slab.h | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 69c2a1e1529e..7dd430b697aa 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1149,7 +1149,7 @@ extern void flush_thread(void); | |||
1149 | extern void exit_thread(void); | 1149 | extern void exit_thread(void); |
1150 | 1150 | ||
1151 | extern void exit_files(struct task_struct *); | 1151 | extern void exit_files(struct task_struct *); |
1152 | extern void exit_signal(struct task_struct *); | 1152 | extern void __cleanup_signal(struct signal_struct *); |
1153 | extern void __exit_signal(struct task_struct *); | 1153 | extern void __exit_signal(struct task_struct *); |
1154 | extern void __exit_sighand(struct task_struct *); | 1154 | extern void __exit_sighand(struct task_struct *); |
1155 | extern void exit_itimers(struct signal_struct *); | 1155 | extern void exit_itimers(struct signal_struct *); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 15e1d9736b1b..3af03b19c983 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -210,7 +210,6 @@ extern kmem_cache_t *names_cachep; | |||
210 | extern kmem_cache_t *files_cachep; | 210 | extern kmem_cache_t *files_cachep; |
211 | extern kmem_cache_t *filp_cachep; | 211 | extern kmem_cache_t *filp_cachep; |
212 | extern kmem_cache_t *fs_cachep; | 212 | extern kmem_cache_t *fs_cachep; |
213 | extern kmem_cache_t *signal_cachep; | ||
214 | extern kmem_cache_t *sighand_cachep; | 213 | extern kmem_cache_t *sighand_cachep; |
215 | extern kmem_cache_t *bio_cachep; | 214 | extern kmem_cache_t *bio_cachep; |
216 | 215 | ||