]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: Fix loop in smc_listen
authorGuo DaXing <guodaxing@huawei.com>
Wed, 24 Nov 2021 12:32:38 +0000 (13:32 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Nov 2021 03:02:21 +0000 (19:02 -0800)
commitbca6ab2db8197cd29df529e43e07bd3548fec7fd
tree4e0d554896333088331513eb44afea282b4992ab
parenta886d69b1c6392ff1d0701c86111179344134cb7
net/smc: Fix loop in smc_listen

The kernel_listen function in smc_listen will fail when all the available
ports are occupied.  At this point smc->clcsock->sk->sk_data_ready has
been changed to smc_clcsock_data_ready.  When we call smc_listen again,
now both smc->clcsock->sk->sk_data_ready and smc->clcsk_data_ready point
to the smc_clcsock_data_ready function.

The smc_clcsock_data_ready() function calls lsmc->clcsk_data_ready which
now points to itself resulting in an infinite loop.

This patch restores smc->clcsock->sk->sk_data_ready with the old value.

Fixes: 8d4dc116db0e ("net/smc: reduce active tcp_listen workers")
Signed-off-by: Guo DaXing <guodaxing@huawei.com>
Acked-by: Tony Lu <tonylu@linux.alibaba.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/af_smc.c