[PATCH] Fix suspend with traced tasks
authorPavel Machek <pavel@suse.cz>
Fri, 31 Mar 2006 10:30:06 +0000 (02:30 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 31 Mar 2006 20:18:50 +0000 (12:18 -0800)
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: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/power/process.c
kernel/signal.c

index 8ac7c35fad7708ea8136b3e19062ddf05f9f16c0..b2a5f671d6cd3f2d164e44ad20ad7780a7e00377 100644 (file)
@@ -26,8 +26,7 @@ static inline int freezeable(struct task_struct * p)
            (p->flags & PF_NOFREEZE) ||
            (p->exit_state == EXIT_ZOMBIE) ||
            (p->exit_state == EXIT_DEAD) ||
-           (p->state == TASK_STOPPED) ||
-           (p->state == TASK_TRACED))
+           (p->state == TASK_STOPPED))
                return 0;
        return 1;
 }
index 4922928d91f68d1c1b7812bb77508a51d0f9e722..92025b10879194d2028944a7076d31757463e0b0 100644 (file)
@@ -1560,6 +1560,7 @@ static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info)
        /* Let the debugger run.  */
        set_current_state(TASK_TRACED);
        spin_unlock_irq(&current->sighand->siglock);
+       try_to_freeze();
        read_lock(&tasklist_lock);
        if (likely(current->ptrace & PT_PTRACED) &&
            likely(current->parent != current->real_parent ||