From: Benjamin Coddington Date: Tue, 23 Sep 2014 16:26:20 +0000 (-0400) Subject: lockd: Try to reconnect if statd has moved X-Git-Tag: v3.4.106~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e65d449fb0fd36359fbcfef34198135d223a4d0;p=thirdparty%2Fkernel%2Fstable.git lockd: Try to reconnect if statd has moved 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 Signed-off-by: Trond Myklebust Signed-off-by: Zefan Li --- diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 606a8dd8818cc..0a68e0b228397 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c @@ -114,6 +114,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, RPC_TASK_SOFTCONN); + } if (status < 0) dprintk("lockd: NSM upcall RPC failed, status=%d\n", status);