summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2020-07-14 12:18:01 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-07-14 12:18:01 -0700
commitec2ffdf65f8b2b64f3f40062f0a24861b72cf39f (patch)
treeabf9938a2452964a9f2d39b2501f78fe90f7dbe2 /kernel/fork.c
parent11bb2f7a45909f4f64afe471875672ae1b84a380 (diff)
parentf06b71fe4d4cd0a4ad7e183b777564f696f6bb36 (diff)
Merge branch 'usermode-driver-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace into bpf-next
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index efc5493203ae..1b94965293da 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1787,22 +1787,18 @@ static void pidfd_show_fdinfo(struct seq_file *m, struct file *f)
*/
static __poll_t pidfd_poll(struct file *file, struct poll_table_struct *pts)
{
- struct task_struct *task;
struct pid *pid = file->private_data;
__poll_t poll_flags = 0;
poll_wait(file, &pid->wait_pidfd, pts);
- rcu_read_lock();
- task = pid_task(pid, PIDTYPE_PID);
/*
* Inform pollers only when the whole thread group exits.
* If the thread group leader exits before all other threads in the
* group, then poll(2) should block, similar to the wait(2) family.
*/
- if (!task || (task->exit_state && thread_group_empty(task)))
+ if (thread_group_exited(pid))
poll_flags = EPOLLIN | EPOLLRDNORM;
- rcu_read_unlock();
return poll_flags;
}