Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

If there are RDMA 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: Neil Brown <neilb@suse.de>
Fixes: 63cae47005af ("xprtrdma: Handle incoming backward direction RPC calls")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

authored by

Trond Myklebust and committed by
Anna Schumaker
9edb455e 875f0706

+2
+2
net/sunrpc/xprtrdma/backchannel.c
··· 163 163 spin_lock(&xprt->bc_pa_lock); 164 164 list_add_tail(&rqst->rq_bc_pa_list, &xprt->bc_pa_list); 165 165 spin_unlock(&xprt->bc_pa_lock); 166 + xprt_put(xprt); 166 167 } 167 168 168 169 static struct rpc_rqst *rpcrdma_bc_rqst_get(struct rpcrdma_xprt *r_xprt) ··· 260 259 261 260 /* Queue rqst for ULP's callback service */ 262 261 bc_serv = xprt->bc_serv; 262 + xprt_get(xprt); 263 263 spin_lock(&bc_serv->sv_cb_lock); 264 264 list_add(&rqst->rq_bc_list, &bc_serv->sv_cb_list); 265 265 spin_unlock(&bc_serv->sv_cb_lock);