]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
SUNRPC: ECONNRESET might require a rebind
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 17 Sep 2023 13:06:05 +0000 (09:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:14:52 +0000 (17:14 +0000)
[ Upstream commit 4b09ca1508a60be30b2e3940264e93d7aeb5c97e ]

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: fd01b2597941 ("SUNRPC: ECONNREFUSED should cause a rebind.")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/clnt.c

index 9fb0ccabc1a26fe363104c7ce60afd7de9a4199e..2e3b7b2c1b4317e48feded91f8d7b6e82122e296 100644 (file)
@@ -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;
@@ -2177,7 +2178,6 @@ call_connect_status(struct rpc_task *task)
                        goto out_retry;
                }
                fallthrough;
-       case -ECONNRESET:
        case -ECONNABORTED:
        case -ENETDOWN:
        case -ENETUNREACH: