kernel_optimize_test/net/smc
Karsten Graul f15f7716b0 net/smc: fix wait on already cleared link
[ Upstream commit 8f3d65c166797746455553f4eaf74a5f89f996d4 ]

There can be a race between the waiters for a tx work request buffer
and the link down processing that finally clears the link. Although
all waiters are woken up before the link is cleared there might be
waiters which did not yet get back control and are still waiting.
This results in an access to a cleared wait queue head.

Fix this by introducing atomic reference counting around the wait calls,
and wait with the link clear processing until all waiters have finished.
Move the work request layer related calls into smc_wr.c and set the
link state to INACTIVE before calling smcr_link_clear() in
smc_llc_srv_add_link().

Fixes: 15e1b99aad ("net/smc: no WR buffer wait for terminating link group")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Guvenc Gulce <guvenc@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-18 08:59:10 +02:00
..
af_smc.c smc: disallow TCP_ULP in smc_setsockopt() 2021-05-19 10:13:08 +02:00
Kconfig
Makefile
smc_cdc.c
smc_cdc.h
smc_clc.c
smc_clc.h net/smc: Replace zero-length array with flexible-array member 2020-10-30 16:57:42 -05:00
smc_close.c
smc_close.h
smc_core.c net/smc: fix matching of existing link groups 2020-11-19 10:59:19 -08:00
smc_core.h net/smc: fix wait on already cleared link 2021-08-18 08:59:10 +02:00
smc_diag.c
smc_ib.c net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() 2020-11-19 10:59:19 -08:00
smc_ib.h
smc_ism.c net/smc: remove device from smcd_dev_list after failed device_add() 2021-06-03 09:00:48 +02:00
smc_ism.h
smc_llc.c net/smc: fix wait on already cleared link 2021-08-18 08:59:10 +02:00
smc_llc.h
smc_netns.h
smc_pnet.c
smc_pnet.h
smc_rx.c
smc_rx.h
smc_tx.c net/smc: fix wait on already cleared link 2021-08-18 08:59:10 +02:00
smc_tx.h
smc_wr.c net/smc: fix wait on already cleared link 2021-08-18 08:59:10 +02:00
smc_wr.h
smc.h