[PATCH] suspend to disk fails if gdb is suspended with a traced child
authorRafael J. Wysocki <rjw@sisk.pl>
Thu, 7 Dec 2006 04:34:34 +0000 (20:34 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Thu, 7 Dec 2006 16:39:28 +0000 (08:39 -0800)
Fix http://bugzilla.kernel.org/show_bug.cgi?id=7534

Fix the freezing of processes so that it won't fail if there is a traced
process the parent of which has been stopped.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: maurice barnum <pixi+kbug@burble.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/power/process.c

index cba8a5890eda822bbb1c2730ac2e5866e30e3ab3..1badb9a89ade03e45b705513deac04c8f0ab1e57 100644 (file)
@@ -97,7 +97,9 @@ int freeze_processes(void)
                                continue;
                        if (frozen(p))
                                continue;
-                       if (p->state == TASK_TRACED && frozen(p->parent)) {
+                       if (p->state == TASK_TRACED &&
+                           (frozen(p->parent) ||
+                            p->parent->state == TASK_STOPPED)) {
                                cancel_freezing(p);
                                continue;
                        }