Commit 1caf7d50 authored by Joel Fernandes (Google)'s avatar Joel Fernandes (Google) Committed by Christian Brauner

pidfd: Add warning if exit_state is 0 during notification

Previously a condition got missed where the pidfd waiters are awakened
before the exit_state gets set. This can result in a missed notification
[1] and the polling thread waiting forever.

It is fixed now, however it would be nice to avoid this kind of issue
going unnoticed in the future. So just add a warning to catch it in the
future.

/* References */
[1]: https://lore.kernel.org/lkml/20190717172100.261204-1-joel@joelfernandes.org/Signed-off-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
Link: https://lore.kernel.org/r/20190724164816.201099-1-joel@joelfernandes.orgSigned-off-by: default avatarChristian Brauner <christian@brauner.io>
parent 3884ae44
...@@ -1885,6 +1885,7 @@ static void do_notify_pidfd(struct task_struct *task) ...@@ -1885,6 +1885,7 @@ static void do_notify_pidfd(struct task_struct *task)
{ {
struct pid *pid; struct pid *pid;
WARN_ON(task->exit_state == 0);
pid = task_pid(task); pid = task_pid(task);
wake_up_all(&pid->wait_pidfd); wake_up_all(&pid->wait_pidfd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment