Skip to content

Commit 173b3af

Browse files
bcodding-rhtrondmypd
authored andcommitted
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>
1 parent a743419 commit 173b3af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/lockd/mon.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ static int nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res,
159159

160160
msg.rpc_proc = &clnt->cl_procinfo[proc];
161161
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+
}
162168
if (status < 0)
163169
dprintk("lockd: NSM upcall RPC failed, status=%d\n",
164170
status);

0 commit comments

Comments
 (0)