diff mbox series

[v2,07/11] NFSv4.1 remove xprt from xprt_switch if session trunking test fails

Message ID 20220721220714.22620-8-olga.kornievskaia@gmail.com (mailing list archive)
State New, archived
Headers show
Series Handling session trunking group membership | expand

Commit Message

Olga Kornievskaia July 21, 2022, 10:07 p.m. UTC
If we are doing a session trunking test and it fails for the transport,
then remove this transport from the xprt_switch group.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 9ae7d792beee..b805541f4501 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8924,6 +8924,9 @@  void nfs4_test_session_trunk(struct rpc_clnt *clnt, struct rpc_xprt *xprt,
 
 	if (status == 0)
 		rpc_clnt_xprt_switch_add_xprt(clnt, xprt);
+	else if (rpc_clnt_xprt_switch_has_addr(clnt,
+				(struct sockaddr *)&xprt->addr))
+		rpc_clnt_xprt_switch_remove_xprt(clnt, xprt);
 
 	rpc_put_task(task);
 }