Skip to content

Commit

Permalink
SUNRPC release the transport of a relocated task with an assigned tra…
Browse files Browse the repository at this point in the history
…nsport

commit e13433b upstream.

A relocated task must release its previous transport.

Fixes: 82ee41b ("SUNRPC don't resend a task on an offlined transport")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
olgakorn1 authored and gregkh committed May 12, 2022
1 parent 90c228f commit bacdacb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions net/sunrpc/clnt.c
Expand Up @@ -1065,10 +1065,13 @@ 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 &&
!(test_bit(XPRT_OFFLINE, &task->tk_xprt->state) &&
(task->tk_flags & RPC_TASK_MOVEABLE)))
return;
if (task->tk_xprt) {
if (!(test_bit(XPRT_OFFLINE, &task->tk_xprt->state) &&
(task->tk_flags & RPC_TASK_MOVEABLE)))
return;
xprt_release(task);
xprt_put(task->tk_xprt);
}
if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN)
task->tk_xprt = rpc_task_get_first_xprt(clnt);
else
Expand Down

0 comments on commit bacdacb

Please sign in to comment.