summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorOlga Kornievskaia <kolga@netapp.com>2022-03-24 10:22:58 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 14:23:51 +0200
commit4ee7a4b67770e2c0e62ff8fcc4cd31c0efe740bf (patch)
tree9d16413081873dbc745a5327c01ddb0dd6f938bc /net/sunrpc
parent6195af5ad80198d43e8ec969d06731db2368c4c3 (diff)
downloadlinux-stable-4ee7a4b67770e2c0e62ff8fcc4cd31c0efe740bf.tar.gz
linux-stable-4ee7a4b67770e2c0e62ff8fcc4cd31c0efe740bf.tar.bz2
linux-stable-4ee7a4b67770e2c0e62ff8fcc4cd31c0efe740bf.zip
SUNRPC don't resend a task on an offlined transport
[ Upstream commit 82ee41b85cef16b4be1f4732650012d9baaedddd ] When a task is being retried, due to an NFS error, if the assigned transport has been put offline and the task is relocatable pick a new transport. Fixes: 6f081693e7b2b ("sunrpc: remove an offlined xprt using sysfs") Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/clnt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 5da1d7e8468a..5d5627bf3b18 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1065,7 +1065,9 @@ rpc_task_get_next_xprt(struct rpc_clnt *clnt)
static
void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt)
{
- if (task->tk_xprt)
+ if (task->tk_xprt &&
+ !(test_bit(XPRT_OFFLINE, &task->tk_xprt->state) &&
+ (task->tk_flags & RPC_TASK_MOVEABLE)))
return;
if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN)
task->tk_xprt = rpc_task_get_first_xprt(clnt);