lkml.org 
[lkml]   [2011]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 1/1] kthreads: allow_signal: don't play with ->blocked
    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@redhat.com>
    ---

    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


    \
     
     \ /
      Last update: 2011-08-16 21:49    [W:2.290 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site