提交 85b6bce3 编写于 作者: P Pavel Machek 提交者: Linus Torvalds

[PATCH] Fix suspend with traced tasks

strace /bin/bash misbehaves after resume; this fixes it.

(akpm: it's scary calling refrigerator() in state TASK_TRACED, but it seems to
do the right thing).
Signed-off-by: NPavel Machek <pavel@suse.cz>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1a75a3f0
...@@ -26,8 +26,7 @@ static inline int freezeable(struct task_struct * p) ...@@ -26,8 +26,7 @@ static inline int freezeable(struct task_struct * p)
(p->flags & PF_NOFREEZE) || (p->flags & PF_NOFREEZE) ||
(p->exit_state == EXIT_ZOMBIE) || (p->exit_state == EXIT_ZOMBIE) ||
(p->exit_state == EXIT_DEAD) || (p->exit_state == EXIT_DEAD) ||
(p->state == TASK_STOPPED) || (p->state == TASK_STOPPED))
(p->state == TASK_TRACED))
return 0; return 0;
return 1; return 1;
} }
......
...@@ -1560,6 +1560,7 @@ static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info) ...@@ -1560,6 +1560,7 @@ static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info)
/* Let the debugger run. */ /* Let the debugger run. */
set_current_state(TASK_TRACED); set_current_state(TASK_TRACED);
spin_unlock_irq(&current->sighand->siglock); spin_unlock_irq(&current->sighand->siglock);
try_to_freeze();
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
if (likely(current->ptrace & PT_PTRACED) && if (likely(current->ptrace & PT_PTRACED) &&
likely(current->parent != current->real_parent || likely(current->parent != current->real_parent ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册