SUNRPC: Ensure the RPC client only quits on fatal signals
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 17 Jun 2011 14:14:59 +0000 (10:14 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 17 Jun 2011 14:17:19 +0000 (10:17 -0400)
Fix a couple of instances where we were exiting the RPC client on
arbitrary signals. We should only do so on fatal signals.

Cc: stable@kernel.org
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/clnt.c

index 339ba64cce1e2ee7134a2c9d09cd64f5fb9cb85e..5daf6cc4faea19f39081765433f4cf2333280605 100644 (file)
@@ -577,13 +577,13 @@ retry:
        }
        inode = &gss_msg->inode->vfs_inode;
        for (;;) {
-               prepare_to_wait(&gss_msg->waitqueue, &wait, TASK_INTERRUPTIBLE);
+               prepare_to_wait(&gss_msg->waitqueue, &wait, TASK_KILLABLE);
                spin_lock(&inode->i_lock);
                if (gss_msg->ctx != NULL || gss_msg->msg.errno < 0) {
                        break;
                }
                spin_unlock(&inode->i_lock);
-               if (signalled()) {
+               if (fatal_signal_pending(current)) {
                        err = -ERESTARTSYS;
                        goto out_intr;
                }
index 566bcfd067f67d6cbfa35d9cd60b579994d443cd..8c9141583d6f135714eac27c100e4bc9c3426631 100644 (file)
@@ -1061,7 +1061,7 @@ call_allocate(struct rpc_task *task)
 
        dprintk("RPC: %5u rpc_buffer allocation failed\n", task->tk_pid);
 
-       if (RPC_IS_ASYNC(task) || !signalled()) {
+       if (RPC_IS_ASYNC(task) || !fatal_signal_pending(current)) {
                task->tk_action = call_allocate;
                rpc_delay(task, HZ>>4);
                return;