Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lockd: Try to reconnect if statd has moved

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>

authored by

Benjamin Coddington and committed by
Trond Myklebust
173b3afc a743419f

+6
+6
fs/lockd/mon.c
··· 159 159 160 160 msg.rpc_proc = &clnt->cl_procinfo[proc]; 161 161 status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFTCONN); 162 + if (status == -ECONNREFUSED) { 163 + dprintk("lockd: NSM upcall RPC failed, status=%d, forcing rebind\n", 164 + status); 165 + rpc_force_rebind(clnt); 166 + status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFTCONN); 167 + } 162 168 if (status < 0) 163 169 dprintk("lockd: NSM upcall RPC failed, status=%d\n", 164 170 status);