aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-10-20 00:23:51 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-20 02:04:31 -0400
commitd1209d049bbc3df66650f8417637be4f7b57b604 (patch)
tree0712622c596cd3ca93234e8eca661240b5fa042b /kernel
parentf9b25fabfddf142b5af8268692701d386cf37e4f (diff)
[PATCH] Threads shouldn't inherit PF_NOFREEZE
The PF_NOFREEZE process flag should not be inherited when a thread is forked. This patch (as585) removes the flag from the child. This problem is starting to show up more and more as drivers turn to the kthread API instead of using kernel_thread(). As a result, their kernel threads are now children of the kthread worker instead of modprobe, and they inherit the PF_NOFREEZE flag. This can cause problems during system suspend; the kernel threads are not getting frozen as they ought to be. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 533ce27f4b2c..280bd44ac441 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -848,7 +848,7 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p)
848{ 848{
849 unsigned long new_flags = p->flags; 849 unsigned long new_flags = p->flags;
850 850
851 new_flags &= ~PF_SUPERPRIV; 851 new_flags &= ~(PF_SUPERPRIV | PF_NOFREEZE);
852 new_flags |= PF_FORKNOEXEC; 852 new_flags |= PF_FORKNOEXEC;
853 if (!(clone_flags & CLONE_PTRACE)) 853 if (!(clone_flags & CLONE_PTRACE))
854 p->ptrace = 0; 854 p->ptrace = 0;