SUNRPC: ECONNRESET might require a rebind

[ Upstream commit 4b09ca1508 ]

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: fd01b25979 ("SUNRPC: ECONNREFUSED should cause a rebind.")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Trond Myklebust 2023-09-17 09:06:05 -04:00 committed by Greg Kroah-Hartman
parent 11f6aadd1f
commit 8d02b6fb3c

View file

@ -2157,6 +2157,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;
@ -2165,7 +2166,6 @@ call_connect_status(struct rpc_task *task)
goto out_retry;
}
fallthrough;
case -ECONNRESET:
case -ECONNABORTED:
case -ENETDOWN:
case -ENETUNREACH: