diff --git a/net/smc/smc_close.c b/net/smc/smc_close.c index 1d706c581592c983713dcd31868ba642c561ffe0..2bbcd45a421e75e27814ffcfde2af55b2385501f 100644 --- a/net/smc/smc_close.c +++ b/net/smc/smc_close.c @@ -13,6 +13,7 @@ #include #include +#include #include "smc.h" #include "smc_tx.h" @@ -102,7 +103,7 @@ static int smc_close_final(struct smc_connection *conn) return smc_cdc_get_slot_and_msg_send(conn); } -static int smc_close_abort(struct smc_connection *conn) +int smc_close_abort(struct smc_connection *conn) { conn->local_tx_ctrl.conn_state_flags.peer_conn_abort = 1; @@ -118,10 +119,8 @@ static void smc_close_active_abort(struct smc_sock *smc) if (sk->sk_state != SMC_INIT && smc->clcsock && smc->clcsock->sk) { sk->sk_err = ECONNABORTED; - if (smc->clcsock && smc->clcsock->sk) { - smc->clcsock->sk->sk_err = ECONNABORTED; - smc->clcsock->sk->sk_state_change(smc->clcsock->sk); - } + if (smc->clcsock && smc->clcsock->sk) + tcp_abort(smc->clcsock->sk, ECONNABORTED); } switch (sk->sk_state) { case SMC_ACTIVE: diff --git a/net/smc/smc_close.h b/net/smc/smc_close.h index e0e3b5df25d2474b8aadd2e7639d07e0c8c631ef..084c4f37aa963577edcb21191cb45833d6df2557 100644 --- a/net/smc/smc_close.h +++ b/net/smc/smc_close.h @@ -24,5 +24,6 @@ int smc_close_active(struct smc_sock *smc); int smc_close_shutdown_write(struct smc_sock *smc); void smc_close_init(struct smc_sock *smc); void smc_clcsock_release(struct smc_sock *smc); +int smc_close_abort(struct smc_connection *conn); #endif /* SMC_CLOSE_H */ diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index e7e9dbcd7d8bf5c14816d08076a4ee9864aac684..494288f32df611ee784ce50981c8a933b0eef01d 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -513,8 +513,8 @@ static void __smc_lgr_terminate(struct smc_link_group *lgr) smc = container_of(conn, struct smc_sock, conn); lock_sock(&smc->sk); sock_hold(&smc->sk); /* sock_put in close work */ + smc_close_abort(conn); conn->killed = 1; - conn->local_tx_ctrl.conn_state_flags.peer_conn_abort = 1; smc_lgr_unregister_conn(conn); conn->lgr = NULL; if (!schedule_work(&conn->close_work))