Skip to content

Commit e13433b

Browse files
olgakorn1Trond Myklebust
authored andcommitted
SUNRPC release the transport of a relocated task with an assigned transport
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>
1 parent b2d229d commit e13433b

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

net/sunrpc/clnt.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,10 +1065,13 @@ rpc_task_get_next_xprt(struct rpc_clnt *clnt)
10651065
static
10661066
void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt)
10671067
{
1068-
if (task->tk_xprt &&
1069-
!(test_bit(XPRT_OFFLINE, &task->tk_xprt->state) &&
1070-
(task->tk_flags & RPC_TASK_MOVEABLE)))
1071-
return;
1068+
if (task->tk_xprt) {
1069+
if (!(test_bit(XPRT_OFFLINE, &task->tk_xprt->state) &&
1070+
(task->tk_flags & RPC_TASK_MOVEABLE)))
1071+
return;
1072+
xprt_release(task);
1073+
xprt_put(task->tk_xprt);
1074+
}
10721075
if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN)
10731076
task->tk_xprt = rpc_task_get_first_xprt(clnt);
10741077
else

0 commit comments

Comments
 (0)