Skip to content

Commit

Permalink
net/smc: cancel tx worker in case of socket aborts
Browse files Browse the repository at this point in the history
If an SMC socket is aborted, the tx worker should be cancelled.

Signed-off-by: Ursula Braun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Ursula Braun authored and davem330 committed Jan 25, 2018
1 parent 2611df7 commit 611b63a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions net/smc/smc_close.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ static void smc_close_active_abort(struct smc_sock *smc)
case SMC_INIT:
case SMC_ACTIVE:
sk->sk_state = SMC_PEERABORTWAIT;
release_sock(sk);
cancel_delayed_work_sync(&smc->conn.tx_work);
lock_sock(sk);
break;
case SMC_APPCLOSEWAIT1:
case SMC_APPCLOSEWAIT2:
Expand All @@ -116,6 +119,9 @@ static void smc_close_active_abort(struct smc_sock *smc)
sk->sk_state = SMC_PEERABORTWAIT;
else
sk->sk_state = SMC_CLOSED;
release_sock(sk);
cancel_delayed_work_sync(&smc->conn.tx_work);
lock_sock(sk);
break;
case SMC_PEERCLOSEWAIT1:
case SMC_PEERCLOSEWAIT2:
Expand Down Expand Up @@ -249,9 +255,6 @@ int smc_close_active(struct smc_sock *smc)
/* peer sending PeerConnectionClosed will cause transition */
break;
case SMC_PROCESSABORT:
release_sock(sk);
cancel_delayed_work_sync(&conn->tx_work);
lock_sock(sk);
smc_close_abort(conn);
sk->sk_state = SMC_CLOSED;
break;
Expand Down Expand Up @@ -327,6 +330,9 @@ static void smc_close_passive_work(struct work_struct *work)
rxflags = &conn->local_rx_ctrl.conn_state_flags;
if (rxflags->peer_conn_abort) {
smc_close_passive_abort_received(smc);
release_sock(&smc->sk);
cancel_delayed_work_sync(&conn->tx_work);
lock_sock(&smc->sk);
goto wakeup;
}

Expand Down

0 comments on commit 611b63a

Please sign in to comment.