Skip to content

Commit 6bd1a77

Browse files
olgakorn1Trond Myklebust
authored andcommitted
NFSv4.1: fix handling NFS4ERR_DELAY when testing for session trunking
Currently when client sends an EXCHANGE_ID for a possible trunked connection, for any error that happened, the trunk will be thrown out. However, an NFS4ERR_DELAY is a transient error that should be retried instead. Fixes: e818bd0 ("NFSv4.1 remove xprt from xprt_switch if session trunking test fails") Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent a68c6fb commit 6bd1a77

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/nfs/nfs4proc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8959,6 +8959,7 @@ void nfs4_test_session_trunk(struct rpc_clnt *clnt, struct rpc_xprt *xprt,
89598959

89608960
sp4_how = (adata->clp->cl_sp4_flags == 0 ? SP4_NONE : SP4_MACH_CRED);
89618961

8962+
try_again:
89628963
/* Test connection for session trunking. Async exchange_id call */
89638964
task = nfs4_run_exchange_id(adata->clp, adata->cred, sp4_how, xprt);
89648965
if (IS_ERR(task))
@@ -8971,11 +8972,15 @@ void nfs4_test_session_trunk(struct rpc_clnt *clnt, struct rpc_xprt *xprt,
89718972

89728973
if (status == 0)
89738974
rpc_clnt_xprt_switch_add_xprt(clnt, xprt);
8974-
else if (rpc_clnt_xprt_switch_has_addr(clnt,
8975+
else if (status != -NFS4ERR_DELAY && rpc_clnt_xprt_switch_has_addr(clnt,
89758976
(struct sockaddr *)&xprt->addr))
89768977
rpc_clnt_xprt_switch_remove_xprt(clnt, xprt);
89778978

89788979
rpc_put_task(task);
8980+
if (status == -NFS4ERR_DELAY) {
8981+
ssleep(1);
8982+
goto try_again;
8983+
}
89798984
}
89808985
EXPORT_SYMBOL_GPL(nfs4_test_session_trunk);
89818986

0 commit comments

Comments
 (0)