Skip to content
Snippets Groups Projects
Commit 81be24b8 authored by Tejun Heo's avatar Tejun Heo Committed by Oleg Nesterov
Browse files

ptrace: relocate set_current_state(TASK_TRACED) in ptrace_stop()


In ptrace_stop(), after arch hook is done, the task state and jobctl
bits are updated while holding siglock.  The ordering requirement
there is that TASK_TRACED is set before JOBCTL_TRAPPING is cleared to
prevent ptracer waiting on TRAPPING doesn't end up waking up TRACED is
actually set and sees TASK_RUNNING in wait(2).

Move set_current_state(TASK_TRACED) to the top of the block and
reorganize comments.  This makes the ordering more obvious
(TASK_TRACED before other updates) and helps future updates to group
stop participation.

This patch doesn't cause any functional change.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
parent 755e276b
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment