|
@@ -590,6 +590,7 @@ static inline int de_thread(struct task_struct *tsk)
|
|
struct signal_struct *sig = tsk->signal;
|
|
struct signal_struct *sig = tsk->signal;
|
|
struct sighand_struct *newsighand, *oldsighand = tsk->sighand;
|
|
struct sighand_struct *newsighand, *oldsighand = tsk->sighand;
|
|
spinlock_t *lock = &oldsighand->siglock;
|
|
spinlock_t *lock = &oldsighand->siglock;
|
|
|
|
+ struct task_struct *leader = NULL;
|
|
int count;
|
|
int count;
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -665,7 +666,7 @@ static inline int de_thread(struct task_struct *tsk)
|
|
* and to assume its PID:
|
|
* and to assume its PID:
|
|
*/
|
|
*/
|
|
if (!thread_group_leader(current)) {
|
|
if (!thread_group_leader(current)) {
|
|
- struct task_struct *leader = current->group_leader, *parent;
|
|
|
|
|
|
+ struct task_struct *parent;
|
|
struct dentry *proc_dentry1, *proc_dentry2;
|
|
struct dentry *proc_dentry1, *proc_dentry2;
|
|
unsigned long exit_state, ptrace;
|
|
unsigned long exit_state, ptrace;
|
|
|
|
|
|
@@ -674,6 +675,7 @@ static inline int de_thread(struct task_struct *tsk)
|
|
* It should already be zombie at this point, most
|
|
* It should already be zombie at this point, most
|
|
* of the time.
|
|
* of the time.
|
|
*/
|
|
*/
|
|
|
|
+ leader = current->group_leader;
|
|
while (leader->exit_state != EXIT_ZOMBIE)
|
|
while (leader->exit_state != EXIT_ZOMBIE)
|
|
yield();
|
|
yield();
|
|
|
|
|
|
@@ -733,7 +735,6 @@ static inline int de_thread(struct task_struct *tsk)
|
|
proc_pid_flush(proc_dentry2);
|
|
proc_pid_flush(proc_dentry2);
|
|
|
|
|
|
BUG_ON(exit_state != EXIT_ZOMBIE);
|
|
BUG_ON(exit_state != EXIT_ZOMBIE);
|
|
- release_task(leader);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -743,8 +744,11 @@ static inline int de_thread(struct task_struct *tsk)
|
|
sig->flags = 0;
|
|
sig->flags = 0;
|
|
|
|
|
|
no_thread_group:
|
|
no_thread_group:
|
|
- BUG_ON(atomic_read(&sig->count) != 1);
|
|
|
|
exit_itimers(sig);
|
|
exit_itimers(sig);
|
|
|
|
+ if (leader)
|
|
|
|
+ release_task(leader);
|
|
|
|
+
|
|
|
|
+ BUG_ON(atomic_read(&sig->count) != 1);
|
|
|
|
|
|
if (atomic_read(&oldsighand->count) == 1) {
|
|
if (atomic_read(&oldsighand->count) == 1) {
|
|
/*
|
|
/*
|