]> git.dujemihanovic.xyz Git - linux.git/commitdiff
SUNRPC don't resend a task on an offlined transport
authorOlga Kornievskaia <kolga@netapp.com>
Thu, 24 Mar 2022 14:22:58 +0000 (10:22 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 24 Mar 2022 16:06:07 +0000 (12:06 -0400)
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>
net/sunrpc/clnt.c

index 0f54a56d19d27c8f639b6da8a2d323032f34e204..8bf2af8546d2fb886808d149d69bc90a95cd9b06 100644 (file)
@@ -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);