aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h5
-rw-r--r--kernel/exit.c5
2 files changed, 2 insertions, 8 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0cb4f097f76c..39acee2c8929 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2318,11 +2318,6 @@ static inline int thread_group_empty(struct task_struct *p)
2318#define delay_group_leader(p) \ 2318#define delay_group_leader(p) \
2319 (thread_group_leader(p) && !thread_group_empty(p)) 2319 (thread_group_leader(p) && !thread_group_empty(p))
2320 2320
2321static inline int task_detached(struct task_struct *p)
2322{
2323 return p->exit_signal == -1;
2324}
2325
2326/* 2321/*
2327 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring 2322 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
2328 * subscriptions and synchronises with wait4(). Also used in procfs. Also 2323 * subscriptions and synchronises with wait4(). Also used in procfs. Also
diff --git a/kernel/exit.c b/kernel/exit.c
index 2b1ba8048a14..9fa99702645d 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -189,7 +189,6 @@ repeat:
189 zap_leader = 0; 189 zap_leader = 0;
190 leader = p->group_leader; 190 leader = p->group_leader;
191 if (leader != p && thread_group_empty(leader) && leader->exit_state == EXIT_ZOMBIE) { 191 if (leader != p && thread_group_empty(leader) && leader->exit_state == EXIT_ZOMBIE) {
192 BUG_ON(task_detached(leader));
193 /* 192 /*
194 * If we were the last child thread and the leader has 193 * If we were the last child thread and the leader has
195 * exited already, and the leader's parent ignores SIGCHLD, 194 * exited already, and the leader's parent ignores SIGCHLD,
@@ -1231,9 +1230,9 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
1231 traced = ptrace_reparented(p); 1230 traced = ptrace_reparented(p);
1232 /* 1231 /*
1233 * It can be ptraced but not reparented, check 1232 * It can be ptraced but not reparented, check
1234 * !task_detached() to filter out sub-threads. 1233 * thread_group_leader() to filter out sub-threads.
1235 */ 1234 */
1236 if (likely(!traced) && likely(!task_detached(p))) { 1235 if (likely(!traced) && thread_group_leader(p)) {
1237 struct signal_struct *psig; 1236 struct signal_struct *psig;
1238 struct signal_struct *sig; 1237 struct signal_struct *sig;
1239 unsigned long maxrss; 1238 unsigned long maxrss;