[PATCH 1/1] kthreads: allow_signal: don't play with ->blocked

From: Oleg Nesterov
Date: Tue Aug 16 2011 - 15:47:48 EST


allow_signal(sig) unblocks the signal. This was only needed because
we had the daemonize()'ed kthreads playing with signals. And daemonize()
can't use ignore_signals() but does sigprocmask(SIG_BLOCK) because it
was used after kernel_thread(CLONE_SIGHAND).

Nobody does this any longer, we can remove this hack. And hopefully
we can deprecate daemonize() soon, all current users do not actually
need it.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
---

kernel/exit.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

--- 3.1/kernel/exit.c~4_allow_signal_dont_unblock 2011-08-16 20:14:20.000000000 +0200
+++ 3.1/kernel/exit.c 2011-08-16 21:20:11.000000000 +0200
@@ -365,7 +365,8 @@ static void set_special_pids(struct pid

/*
* Let kernel threads use this to say that they allow a certain signal.
- * Must not be used if kthread was cloned with CLONE_SIGHAND.
+ * Must not be used if kthread was cloned with CLONE_SIGHAND or daemonize()
+ * was called.
*/
int allow_signal(int sig)
{
@@ -373,8 +374,6 @@ int allow_signal(int sig)
return -EINVAL;

spin_lock_irq(&current->sighand->siglock);
- /* This is only needed for daemonize()'ed kthreads */
- sigdelset(&current->blocked, sig);
/*
* Kernel threads handle their own signals. Let the signal code
* know it'll be handled, so that they don't get converted to

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/