Commit 5789d04b authored by David S. Miller's avatar David S. Miller

Merge branch 'smc-fixes'

Tony Lu says:

====================
smc: Fixes for closing process and minor cleanup

Patch 1 is a minor cleanup for local struct sock variables.

Patch 2 ensures the active closing side enters TIME_WAIT.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 1c743127 606a63c9
...@@ -228,6 +228,12 @@ int smc_close_active(struct smc_sock *smc) ...@@ -228,6 +228,12 @@ int smc_close_active(struct smc_sock *smc)
/* send close request */ /* send close request */
rc = smc_close_final(conn); rc = smc_close_final(conn);
sk->sk_state = SMC_PEERCLOSEWAIT1; sk->sk_state = SMC_PEERCLOSEWAIT1;
/* actively shutdown clcsock before peer close it,
* prevent peer from entering TIME_WAIT state.
*/
if (smc->clcsock && smc->clcsock->sk)
rc = kernel_sock_shutdown(smc->clcsock, SHUT_RDWR);
} else { } else {
/* peer event has changed the state */ /* peer event has changed the state */
goto again; goto again;
...@@ -354,9 +360,9 @@ static void smc_close_passive_work(struct work_struct *work) ...@@ -354,9 +360,9 @@ static void smc_close_passive_work(struct work_struct *work)
if (rxflags->peer_conn_abort) { if (rxflags->peer_conn_abort) {
/* peer has not received all data */ /* peer has not received all data */
smc_close_passive_abort_received(smc); smc_close_passive_abort_received(smc);
release_sock(&smc->sk); release_sock(sk);
cancel_delayed_work_sync(&conn->tx_work); cancel_delayed_work_sync(&conn->tx_work);
lock_sock(&smc->sk); lock_sock(sk);
goto wakeup; goto wakeup;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment