]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
autofs4: Use set_current_blocked()
authorMatt Fleming <matt.fleming@intel.com>
Fri, 19 Aug 2011 16:46:56 +0000 (17:46 +0100)
committerOleg Nesterov <oleg@redhat.com>
Fri, 26 Aug 2011 17:15:47 +0000 (19:15 +0200)
As described in e6fa16ab ("signal: sigprocmask() should do
retarget_shared_pending()") the modification of current->blocked is
incorrect as we need to check whether the signal we're about to block
is pending in the shared queue.

Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Ian Kent <raven@themaw.net>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
fs/autofs4/waitq.c

index e1fbdeef85db2e4b73e78eaf6266d2784e2385b0..58ba49a32ff4e16fff87db2b9d0d93679650c7fb 100644 (file)
@@ -458,21 +458,16 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
         */
        if (wq->name.name) {
                /* Block all but "shutdown" signals while waiting */
-               sigset_t oldset;
+               sigset_t oldset, blocked;
                unsigned long irqflags;
 
-               spin_lock_irqsave(&current->sighand->siglock, irqflags);
                oldset = current->blocked;
-               siginitsetinv(&current->blocked, SHUTDOWN_SIGS & ~oldset.sig[0]);
-               recalc_sigpending();
-               spin_unlock_irqrestore(&current->sighand->siglock, irqflags);
+               siginitsetinv(&blocked, SHUTDOWN_SIGS & ~oldset.sig[0]);
+               set_current_blocked(&blocked);
 
                wait_event_interruptible(wq->queue, wq->name.name == NULL);
 
-               spin_lock_irqsave(&current->sighand->siglock, irqflags);
-               current->blocked = oldset;
-               recalc_sigpending();
-               spin_unlock_irqrestore(&current->sighand->siglock, irqflags);
+               set_current_blocked(&oldset);
        } else {
                DPRINTK("skipped sleeping");
        }