summaryrefslogtreecommitdiff
path: root/net/smc
diff options
context:
space:
mode:
authorKarsten Graul <kgraul@linux.ibm.com>2020-07-18 15:06:10 +0200
committerDavid S. Miller <davem@davemloft.net>2020-07-19 15:30:22 -0700
commit68fd8942038f30dbb64a594dc15d9948289de42a (patch)
treef8c9bba2920f1363ab3c6a7866aa06dbe94858db /net/smc
parenta35fffbf98189ba8359f19073286b2ea816255c5 (diff)
net/smc: clear link during SMC client link down processing
In a link-down condition we notify the SMC server and expect that the server will finally trigger the link clear processing on the client side. This could fail when anything along this notification path goes wrong. Clear the link as part of SMC client link-down processing to prevent dangling links. Reviewed-by: Ursula Braun <ubraun@linux.ibm.com> Fixes: 541afa10c126 ("net/smc: add smcr_port_err() and smcr_link_down() processing") Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/smc_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index f69d205b3e11..e286b3c8c962 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -1204,10 +1204,12 @@ static void smcr_link_down(struct smc_link *lnk)
SMC_LLC_WAIT_TIME);
mutex_lock(&lgr->llc_conf_mutex);
}
- if (!list_empty(&lgr->list))
+ if (!list_empty(&lgr->list)) {
smc_llc_send_delete_link(to_lnk, del_link_id,
SMC_LLC_REQ, true,
SMC_LLC_DEL_LOST_PATH);
+ smcr_link_clear(lnk, true);
+ }
wake_up(&lgr->llc_flow_waiter); /* wake up next waiter */
}
}