sdp: Use the PCB as the rx completion handler argument.

The generic socket may be detached from the PCB before the completion
queue is drained and destroyed, so this change closes a race condition
in connection teardown.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Mark Johnston 2016-07-29 20:39:32 +00:00
parent fa46ade837
commit a3c0b052b7

View File

@ -665,13 +665,10 @@ sdp_process_rx(struct sdp_sock *ssk)
static void
sdp_rx_irq(struct ib_cq *cq, void *cq_context)
{
struct socket *sk = cq_context;
struct sdp_sock *ssk = sdp_sk(sk);
struct sdp_sock *ssk;
if (cq != ssk->rx_ring.cq) {
sdp_dbg(sk, "cq = %p, ssk->cq = %p\n", cq, ssk->rx_ring.cq);
return;
}
ssk = cq_context;
KASSERT(cq == ssk->rx_ring.cq, ("%s: mismatched cq on %p", ssk));
SDPSTATS_COUNTER_INC(rx_int_count);
@ -728,7 +725,7 @@ sdp_rx_ring_create(struct sdp_sock *ssk, struct ib_device *device)
}
rx_cq = ib_create_cq(device, sdp_rx_irq, sdp_rx_cq_event_handler,
ssk->socket, SDP_RX_SIZE, 0);
ssk, SDP_RX_SIZE, 0);
if (IS_ERR(rx_cq)) {
rc = PTR_ERR(rx_cq);