]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] Fix suspend with traced tasks
authorPavel Machek <pavel@suse.cz>
Fri, 31 Mar 2006 10:30:06 +0000 (02:30 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 17 Apr 2006 20:16:06 +0000 (13:16 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/power/process.c
kernel/signal.c

index 28de118f7a0b047c6c507a8adbf2113ce52bb21d..67b2cddfc16098f6daf784e526337b7d83c15e68 100644 (file)
@@ -25,8 +25,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 bc8f80b3fdb0138dabf6d95d9e9a6cf5526f668b..54acb53e4b318c9c2da4b1f5ab7e408814f0c4ca 100644 (file)
@@ -1688,6 +1688,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 ||