Blob Blame History Raw
From: Olga Kornievskaia <kolga@netapp.com>
Date: Thu, 24 Mar 2022 10:38:42 -0400
Subject: [PATCH] NFSv4.1: don't retry BIND_CONN_TO_SESSION on session error
Git-commit: 1d15d121cc2ad4d016a7dc1493132a9696f91fc5
Patch-mainline: v5.18
References: git-fixes

There is no reason to retry the operation if a session error had
occurred in such case result structure isn't filled out.

Fixes: dff58530c4ca ("NFSv4.1: fix handling of backchannel binding in BIND_CONN_TO_SESSION")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Acked-by: NeilBrown <neilb@suse.com>

---
 fs/nfs/nfs4proc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7368,6 +7368,9 @@ nfs4_bind_one_conn_to_session_done(struc
 	struct nfs41_bind_conn_to_session_args *args = task->tk_msg.rpc_argp;
 	struct nfs41_bind_conn_to_session_res *res = task->tk_msg.rpc_resp;
 
+	if (task->tk_status == -NFS4ERR_DEADSESSION)
+		return;
+
 	if (args->dir == NFS4_CDFC4_FORE_OR_BOTH &&
 			res->dir != NFS4_CDFS4_BOTH) {
 		rpc_task_close_connection(task);
@@ -7377,7 +7380,7 @@ nfs4_bind_one_conn_to_session_done(struc
 }
 
 static const struct rpc_call_ops nfs4_bind_one_conn_to_session_ops = {
-	.rpc_call_done =  &nfs4_bind_one_conn_to_session_done,
+	.rpc_call_done = nfs4_bind_one_conn_to_session_done,
 };
 
 /*