Skip to content

Commit

Permalink
RDMA/cm: Spurious WARNING triggered in cm_destroy_id()
Browse files Browse the repository at this point in the history
If the cm_id state is IB_CM_REP_SENT when cm_destroy_id() is called, it
calls cm_send_rej_locked().

In cm_send_rej_locked(), it calls cm_enter_timewait() and the state is
changed to IB_CM_TIMEWAIT.

Now back to cm_destroy_id(), it breaks from the switch statement, and the
next call is WARN_ON(cm_id->state != IB_CM_IDLE).

This triggers a spurious warning. Instead, the code should goto retest
after returning from cm_send_rej_locked() to move the state to IDLE.

Fixes: 67b3c8d ("RDMA/cm: Make sure the cm_id is in the IB_CM_IDLE state in destroy")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ka-Cheong Poon <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
kcp-git authored and jgunthorpe committed Jun 3, 2020
1 parent a645a89 commit fba97dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/infiniband/core/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,9 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
case IB_CM_REP_SENT:
case IB_CM_MRA_REP_RCVD:
ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
/* Fall through */
cm_send_rej_locked(cm_id_priv, IB_CM_REJ_CONSUMER_DEFINED, NULL,
0, NULL, 0);
goto retest;
case IB_CM_MRA_REQ_SENT:
case IB_CM_REP_RCVD:
case IB_CM_MRA_REP_SENT:
Expand Down

0 comments on commit fba97dc

Please sign in to comment.