lockd: Try to reconnect if statd has moved
authorBenjamin Coddington <bcodding@redhat.com>
Tue, 23 Sep 2014 16:26:20 +0000 (12:26 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 25 Sep 2014 03:08:43 +0000 (23:08 -0400)
If rpc.statd is restarted, upcalls to monitor hosts can fail with
ECONNREFUSED.  In that case force a lookup of statd's new port and retry the
upcall.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/lockd/mon.c

index daa8e7514eae7b4d23e485bd94b46ea7f8b8e35d..9106f42c472ca5bd4844c837010a53f77d74685e 100644 (file)
@@ -159,6 +159,12 @@ static int nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res,
 
        msg.rpc_proc = &clnt->cl_procinfo[proc];
        status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFTCONN);
+       if (status == -ECONNREFUSED) {
+               dprintk("lockd: NSM upcall RPC failed, status=%d, forcing rebind\n",
+                               status);
+               rpc_force_rebind(clnt);
+               status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFTCONN);
+       }
        if (status < 0)
                dprintk("lockd: NSM upcall RPC failed, status=%d\n",
                                status);