summaryrefslogtreecommitdiffstats
path: root/net/smc/smc_core.c
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.vnet.ibm.com>2017-01-09 16:55:25 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-09 16:07:40 -0500
commitb38d732477e4211351b2680e805d944f66bceec9 (patch)
treec4d7764d21d9a5e6de2197292c7cf9b75a7aba81 /net/smc/smc_core.c
parent952310ccf2d861966cfb8706f16d5e4eb585edb7 (diff)
downloadlinux-b38d732477e4211351b2680e805d944f66bceec9.tar.gz
linux-b38d732477e4211351b2680e805d944f66bceec9.tar.bz2
linux-b38d732477e4211351b2680e805d944f66bceec9.zip
smc: socket closing and linkgroup cleanup
smc_shutdown() and smc_release() handling delayed linkgroup cleanup for linkgroups without connections Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_core.c')
-rw-r--r--net/smc/smc_core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index e5c63950fc28..8b1d34378829 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -23,6 +23,7 @@
#include "smc_wr.h"
#include "smc_llc.h"
#include "smc_cdc.h"
+#include "smc_close.h"
#define SMC_LGR_NUM_INCR 256
#define SMC_LGR_FREE_DELAY (600 * HZ)
@@ -295,6 +296,7 @@ void smc_lgr_free(struct smc_link_group *lgr)
void smc_lgr_terminate(struct smc_link_group *lgr)
{
struct smc_connection *conn;
+ struct smc_sock *smc;
struct rb_node *node;
spin_lock_bh(&smc_lgr_list.lock);
@@ -311,11 +313,14 @@ void smc_lgr_terminate(struct smc_link_group *lgr)
node = rb_first(&lgr->conns_all);
while (node) {
conn = rb_entry(node, struct smc_connection, alert_node);
+ smc = container_of(conn, struct smc_sock, conn);
+ sock_hold(&smc->sk);
__smc_lgr_unregister_conn(conn);
+ smc_close_active_abort(smc);
+ sock_put(&smc->sk);
node = rb_first(&lgr->conns_all);
}
write_unlock_bh(&lgr->conns_lock);
- schedule_delayed_work(&lgr->free_work, SMC_LGR_FREE_DELAY);
}
/* Determine vlan of internal TCP socket.