Subject: + kthread-fix-return-value-of-kthread_create-upon-sigkill.patch added 
to -mm tree
To: 
[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 03 Jun 2014 14:37:36 -0700


The patch titled
     Subject: kthread: fix return value of kthread_create() upon SIGKILL.
has been added to the -mm tree.  Its filename is
     kthread-fix-return-value-of-kthread_create-upon-sigkill.patch

This patch should soon appear at
    
http://ozlabs.org/~akpm/mmots/broken-out/kthread-fix-return-value-of-kthread_create-upon-sigkill.patch
and later at
    
http://ozlabs.org/~akpm/mmotm/broken-out/kthread-fix-return-value-of-kthread_create-upon-sigkill.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Tetsuo Handa <[email protected]>
Subject: kthread: fix return value of kthread_create() upon SIGKILL.

786235eeb ("kthread: make kthread_create() killable") meant for allowing
kthread_create() to abort as soon as killed by the OOM-killer.  But
returning -ENOMEM is wrong if killed by SIGKILL from userspace.  Change
kthread_create() to return -EINTR upon SIGKILL.

Signed-off-by: Tetsuo Handa <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: <[email protected]> [3.13+]
Signed-off-by: Andrew Morton <[email protected]>
---

 kernel/kthread.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN 
kernel/kthread.c~kthread-fix-return-value-of-kthread_create-upon-sigkill 
kernel/kthread.c
--- a/kernel/kthread.c~kthread-fix-return-value-of-kthread_create-upon-sigkill
+++ a/kernel/kthread.c
@@ -262,7 +262,7 @@ static void create_kthread(struct kthrea
  * kthread_stop() has been called).  The return value should be zero
  * or a negative error number; it will be passed to kthread_stop().
  *
- * Returns a task_struct or ERR_PTR(-ENOMEM).
+ * Returns a task_struct or ERR_PTR(-ENOMEM) or ERR_PTR(-EINTR).
  */
 struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
                                           void *data, int node,
@@ -298,7 +298,7 @@ struct task_struct *kthread_create_on_no
                 * that thread.
                 */
                if (xchg(&create->done, NULL))
-                       return ERR_PTR(-ENOMEM);
+                       return ERR_PTR(-EINTR);
                /*
                 * kthreadd (or new kernel thread) will call complete()
                 * shortly.
_

Patches currently in -mm which might be from [email protected] 
are

kthread-fix-return-value-of-kthread_create-upon-sigkill.patch
lib-vsprintf-add-%pt-format-specifier.patch

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to