Skip to content

Commit

Permalink
net/smc: put slot when connection is killed
Browse files Browse the repository at this point in the history
To get a send slot smc_wr_tx_get_free_slot() is called, which might
wait for a free slot. When smc_wr_tx_get_free_slot() returns there is a
check if the connection was killed in the meantime. In that case don't
only return an error, but also put back the free slot.

Fixes: b290098 ("net/smc: cancel send and receive for terminated socket")
Reviewed-by: Ursula Braun <[email protected]>
Signed-off-by: Karsten Graul <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
karstengr authored and davem330 committed Jul 21, 2020
1 parent 639f181 commit 2bced6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/smc/smc_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ int smc_cdc_get_free_slot(struct smc_connection *conn,
rc = smc_wr_tx_get_free_slot(link, smc_cdc_tx_handler, wr_buf,
wr_rdma_buf,
(struct smc_wr_tx_pend_priv **)pend);
if (conn->killed)
if (conn->killed) {
/* abnormal termination */
if (!rc)
smc_wr_tx_put_slot(link,
(struct smc_wr_tx_pend_priv *)pend);
rc = -EPIPE;
}
return rc;
}

Expand Down

0 comments on commit 2bced6a

Please sign in to comment.