Commit 875f0706 authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

SUNRPC: The TCP back channel mustn't disappear while requests are outstanding

If there are TCP back channel requests being processed by the
server threads, then we should hold a reference to the transport
to ensure it doesn't get freed from underneath us.
Reported-by: default avatarNeil Brown <neilb@suse.de>
Fixes: 2ea24497 ("SUNRPC: RPC callbacks may be split across several..")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 9e5eefba
...@@ -307,8 +307,8 @@ void xprt_free_bc_rqst(struct rpc_rqst *req) ...@@ -307,8 +307,8 @@ void xprt_free_bc_rqst(struct rpc_rqst *req)
*/ */
dprintk("RPC: Last session removed req=%p\n", req); dprintk("RPC: Last session removed req=%p\n", req);
xprt_free_allocation(req); xprt_free_allocation(req);
return;
} }
xprt_put(xprt);
} }
/* /*
...@@ -339,7 +339,7 @@ struct rpc_rqst *xprt_lookup_bc_request(struct rpc_xprt *xprt, __be32 xid) ...@@ -339,7 +339,7 @@ struct rpc_rqst *xprt_lookup_bc_request(struct rpc_xprt *xprt, __be32 xid)
spin_unlock(&xprt->bc_pa_lock); spin_unlock(&xprt->bc_pa_lock);
if (new) { if (new) {
if (req != new) if (req != new)
xprt_free_bc_rqst(new); xprt_free_allocation(new);
break; break;
} else if (req) } else if (req)
break; break;
...@@ -368,6 +368,7 @@ void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied) ...@@ -368,6 +368,7 @@ void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied)
set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
dprintk("RPC: add callback request to list\n"); dprintk("RPC: add callback request to list\n");
xprt_get(xprt);
spin_lock(&bc_serv->sv_cb_lock); spin_lock(&bc_serv->sv_cb_lock);
list_add(&req->rq_bc_list, &bc_serv->sv_cb_list); list_add(&req->rq_bc_list, &bc_serv->sv_cb_list);
wake_up(&bc_serv->sv_cb_waitq); wake_up(&bc_serv->sv_cb_waitq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment