Commit 669996ad authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

SUNRPC: Destroy the back channel when we destroy the host transport

When we're destroying the host transport mechanism, we should ensure
that we do not leak memory by failing to release any back channel
slots that might still exist.
Reported-by: default avatarNeil Brown <>
Reported-by: default avatarkbuild test robot <>
Signed-off-by: default avatarTrond Myklebust <>
Signed-off-by: default avatarAnna Schumaker <>
parent 9edb455e
......@@ -64,6 +64,11 @@ static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
return 0;
static inline void xprt_destroy_backchannel(struct rpc_xprt *xprt,
unsigned int max_reqs)
static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
return false;
......@@ -220,7 +220,7 @@ void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs)
goto out;
xprt->bc_alloc_max -= max_reqs;
xprt->bc_alloc_max -= min(max_reqs, xprt->bc_alloc_max);
list_for_each_entry_safe(req, tmp, &xprt->bc_pa_list, rq_bc_pa_list) {
dprintk("RPC: req=%p\n", req);
......@@ -1942,6 +1942,11 @@ static void xprt_destroy_cb(struct work_struct *work)
* Destroy any existing back channel
xprt_destroy_backchannel(xprt, UINT_MAX);
* Tear down transport state and free the rpc_xprt
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