Skip to content

Commit

Permalink
svcrdma: Drain QP before freeing svcrdma_xprt
Browse files Browse the repository at this point in the history
If the server has forced a disconnect, the associated QP has not
been moved to the Error state, and thus Receives are still posted.

Ensure Receives (and any other outstanding WRs) are drained to
release resources that can be freed during teardown of the
svcrdma_xprt.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed May 13, 2016
1 parent 0319aaf commit 76ee8fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/sunrpc/xprtrdma/svc_rdma_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,9 @@ static void __svc_rdma_free(struct work_struct *work)

dprintk("svcrdma: %s(%p)\n", __func__, rdma);

if (rdma->sc_qp && !IS_ERR(rdma->sc_qp))
ib_drain_qp(rdma->sc_qp);

/* We should only be called from kref_put */
if (atomic_read(&xprt->xpt_ref.refcount) != 0)
pr_err("svcrdma: sc_xprt still in use? (%d)\n",
Expand Down

0 comments on commit 76ee8fd

Please sign in to comment.