From: Matt Fleming Date: Fri, 19 Aug 2011 16:46:56 +0000 (+0100) Subject: autofs4: Use set_current_blocked() X-Git-Tag: next-20110829~17^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=33ee1d9bc213d6bf8144bc8fbd9e6964b9d81fa5;p=karo-tx-linux.git autofs4: Use set_current_blocked() 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 Cc: Ian Kent Signed-off-by: Matt Fleming Signed-off-by: Oleg Nesterov --- diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index e1fbdeef85db..58ba49a32ff4 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c @@ -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(¤t->sighand->siglock, irqflags); oldset = current->blocked; - siginitsetinv(¤t->blocked, SHUTDOWN_SIGS & ~oldset.sig[0]); - recalc_sigpending(); - spin_unlock_irqrestore(¤t->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(¤t->sighand->siglock, irqflags); - current->blocked = oldset; - recalc_sigpending(); - spin_unlock_irqrestore(¤t->sighand->siglock, irqflags); + set_current_blocked(&oldset); } else { DPRINTK("skipped sleeping"); }