]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
lockd: Try to reconnect if statd has moved
authorBenjamin Coddington <bcodding@redhat.com>
Tue, 23 Sep 2014 16:26:20 +0000 (12:26 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 14 Dec 2014 16:23:44 +0000 (16:23 +0000)
commit 173b3afceebe76fa2205b2c8808682d5b541fe3c upstream.

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>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[bwh: Backported to 3.2: not using RPC_TASK_SOFTCONN]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/lockd/mon.c

index 23d7451b2938226c879be67208d2431166ea3466..ef744e1206ec10ae9bdfbf717e5ebdb2382b42b7 100644 (file)
@@ -111,6 +111,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, 0);
+       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, 0);
+       }
        if (status < 0)
                dprintk("lockd: NSM upcall RPC failed, status=%d\n",
                                status);