From 33ee1d9bc213d6bf8144bc8fbd9e6964b9d81fa5 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Fri, 19 Aug 2011 17:46:56 +0100 Subject: [PATCH] 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 --- fs/autofs4/waitq.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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"); } -- 2.39.5