kernel_optimize_test/net/smc
Wen Gu a66b9bccf7 net/smc: Fix hung_task when removing SMC-R devices
commit 56d99e81ecbc997a5f984684d0eeb583992b2072 upstream.

A hung_task is observed when removing SMC-R devices. Suppose that
a link group has two active links(lnk_A, lnk_B) associated with two
different SMC-R devices(dev_A, dev_B). When dev_A is removed, the
link group will be removed from smc_lgr_list and added into
lgr_linkdown_list. lnk_A will be cleared and smcibdev(A)->lnk_cnt
will reach to zero. However, when dev_B is removed then, the link
group can't be found in smc_lgr_list and lnk_B won't be cleared,
making smcibdev->lnk_cnt never reaches zero, which causes a hung_task.

This patch fixes this issue by restoring the implementation of
smc_smcr_terminate_all() to what it was before commit 349d43127dac
("net/smc: fix kernel panic caused by race of smc_sock"). The original
implementation also satisfies the intention that make sure QP destroy
earlier than CQ destroy because we will always wait for smcibdev->lnk_cnt
reaches zero, which guarantees QP has been destroyed.

Fixes: 349d43127dac ("net/smc: fix kernel panic caused by race of smc_sock")
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-27 10:54:32 +01:00
..
af_smc.c net/smc: Prevent smc_release() from long blocking 2021-12-22 09:30:55 +01:00
Kconfig
Makefile
smc_cdc.c net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:40:31 +01:00
smc_cdc.h net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:40:31 +01:00
smc_clc.c net/smc: add missing error check in smc_clc_prfx_set() 2021-09-30 10:11:02 +02:00
smc_clc.h net/smc: Replace zero-length array with flexible-array member 2020-10-30 16:57:42 -05:00
smc_close.c net/smc: Keep smc_close_final rc during active close 2021-12-08 09:03:26 +01:00
smc_close.h
smc_core.c net/smc: Fix hung_task when removing SMC-R devices 2022-01-27 10:54:32 +01:00
smc_core.h net/smc: don't send CDC/LLC message if link not ready 2022-01-05 12:40:31 +01:00
smc_diag.c
smc_ib.c net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:40:31 +01:00
smc_ib.h net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:40:31 +01:00
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 net/smc: introduce CHID callback for ISM devices 2020-09-28 15:19:03 -07:00
smc_llc.c net/smc: don't send CDC/LLC message if link not ready 2022-01-05 12:40:31 +01:00
smc_llc.h
smc_netns.h net/smc: introduce list of pnetids for Ethernet devices 2020-09-28 15:19:03 -07:00
smc_pnet.c net/smc: determine proposed ISM devices 2020-09-28 15:19:03 -07:00
smc_pnet.h net/smc: determine proposed ISM devices 2020-09-28 15:19:03 -07:00
smc_rx.c
smc_rx.h
smc_tx.c net/smc: improved fix wait on already cleared link 2022-01-05 12:40:31 +01:00
smc_tx.h
smc_wr.c net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:40:31 +01:00
smc_wr.h net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:40:31 +01:00
smc.h net/smc: fix kernel panic caused by race of smc_sock 2022-01-05 12:40:31 +01:00