Skip to content

Commit

Permalink
SUNRPC: ECONNRESET might require a rebind
Browse files Browse the repository at this point in the history
[ Upstream commit 4b09ca1 ]

If connect() is returning ECONNRESET, it usually means that nothing is
listening on that port. If so, a rebind might be required in order to
obtain the new port on which the RPC service is listening.

Fixes: fd01b25 ("SUNRPC: ECONNREFUSED should cause a rebind.")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Trond Myklebust authored and gregkh committed Nov 28, 2023
1 parent cc0ccee commit 0b8fb17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,7 @@ call_connect_status(struct rpc_task *task)
task->tk_status = 0;
switch (status) {
case -ECONNREFUSED:
case -ECONNRESET:
/* A positive refusal suggests a rebind is needed. */
if (RPC_IS_SOFTCONN(task))
break;
Expand All @@ -2177,7 +2178,6 @@ call_connect_status(struct rpc_task *task)
goto out_retry;
}
fallthrough;
case -ECONNRESET:
case -ECONNABORTED:
case -ENETDOWN:
case -ENETUNREACH:
Expand Down

0 comments on commit 0b8fb17

Please sign in to comment.