summaryrefslogtreecommitdiff
path: root/net/smc/smc_core.c
diff options
context:
space:
mode:
authorKarsten Graul <kgraul@linux.ibm.com>2018-05-15 18:05:03 +0300
committerDavid S. Miller <davem@davemloft.net>2018-05-16 18:49:20 +0300
commit517c300e8f041ca9a32a5b3204960d77ed1393b6 (patch)
treed8e329c2b5fb5df8ef3dd14c7fda443938da69be /net/smc/smc_core.c
parent8f332a743cd1943c7d1a1fb806bb0261e35d1b65 (diff)
downloadlinux-517c300e8f041ca9a32a5b3204960d77ed1393b6.tar.xz
net/smc: check for pending termination
Avoid to run the processing in smc_lgr_terminate() more than once, remember when the link group termination is triggered. Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Signed-off-by: Ursula Braun <ubraun@linux.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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index a48ee00b65ff..08c05cd0bbae 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -172,7 +172,7 @@ static int smc_lgr_create(struct smc_sock *smc,
goto out;
}
lgr->role = smc->listen_smc ? SMC_SERV : SMC_CLNT;
- lgr->sync_err = false;
+ lgr->sync_err = 0;
memcpy(lgr->peer_systemid, peer_systemid, SMC_SYSTEMID_LEN);
lgr->vlan_id = vlan_id;
rwlock_init(&lgr->sndbufs_lock);
@@ -352,6 +352,9 @@ void smc_lgr_terminate(struct smc_link_group *lgr)
struct smc_sock *smc;
struct rb_node *node;
+ if (lgr->terminating)
+ return; /* lgr already terminating */
+ lgr->terminating = 1;
smc_lgr_forget(lgr);
smc_llc_link_inactive(&lgr->lnk[SMC_SINGLE_LINK]);