Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157108
b: refs/heads/master
c: 4ab6c08
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Aug 27, 2009
1 parent b030fa5 commit 5e6565e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03ef83af528899aa339e42d8024b37e2f434fba4
refs/heads/master: 4ab6c08336535f8c8e42cf45d7adeda882eff06e
20 changes: 5 additions & 15 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,11 +815,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
{
struct signal_struct *sig;

if (clone_flags & CLONE_THREAD) {
atomic_inc(&current->signal->count);
atomic_inc(&current->signal->live);
if (clone_flags & CLONE_THREAD)
return 0;
}

sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
tsk->signal = sig;
Expand Down Expand Up @@ -877,16 +874,6 @@ void __cleanup_signal(struct signal_struct *sig)
kmem_cache_free(signal_cachep, sig);
}

static void cleanup_signal(struct task_struct *tsk)
{
struct signal_struct *sig = tsk->signal;

atomic_dec(&sig->live);

if (atomic_dec_and_test(&sig->count))
__cleanup_signal(sig);
}

static void copy_flags(unsigned long clone_flags, struct task_struct *p)
{
unsigned long new_flags = p->flags;
Expand Down Expand Up @@ -1239,6 +1226,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
}

if (clone_flags & CLONE_THREAD) {
atomic_inc(&current->signal->count);
atomic_inc(&current->signal->live);
p->group_leader = current->group_leader;
list_add_tail_rcu(&p->thread_group, &p->group_leader->thread_group);
}
Expand Down Expand Up @@ -1282,7 +1271,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
if (p->mm)
mmput(p->mm);
bad_fork_cleanup_signal:
cleanup_signal(p);
if (!(clone_flags & CLONE_THREAD))
__cleanup_signal(p->signal);
bad_fork_cleanup_sighand:
__cleanup_sighand(p->sighand);
bad_fork_cleanup_fs:
Expand Down

0 comments on commit 5e6565e

Please sign in to comment.