kthread: fix return value of kthread_create() upon SIGKILL.
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Wed, 4 Jun 2014 23:05:36 +0000 (16:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:11:53 +0000 (20:11 -0700)
commit19801fb4a801cec39a70ff9c0a9c9023bd42a1a1
tree127172ed46b9b09327468771a367a30d79da7127
parent9dbfe4e4a6b45aa5d5e67407445cf7bd4bcffcfc
kthread: fix return value of kthread_create() upon SIGKILL.

commit 8fe6929cfd43c44834858a53e129ffdc7c166298 upstream.

Commit 786235eeba0e ("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 <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/kthread.c