]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: Don't call clcsock shutdown twice when smc shutdown
authorTony Lu <tonylu@linux.alibaba.com>
Fri, 26 Nov 2021 02:41:35 +0000 (10:41 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Nov 2021 19:23:35 +0000 (11:23 -0800)
commit24ae3b643d4e4028c2c7e3e769483c1feee5cf1d
tree0e0d9c47c1eafcfa67e0717c1172184bf2f42482
parent253e59c3c4661ec2ec297ecd23329dbe294cf5e8
net/smc: Don't call clcsock shutdown twice when smc shutdown

When applications call shutdown() with SHUT_RDWR in userspace,
smc_close_active() calls kernel_sock_shutdown(), and it is called
twice in smc_shutdown().

This fixes this by checking sk_state before do clcsock shutdown, and
avoids missing the application's call of smc_shutdown().

Link: https://lore.kernel.org/linux-s390/1f67548e-cbf6-0dce-82b5-10288a4583bd@linux.ibm.com/
Fixes: 5b5d5453db58 ("net/smc: Ensure the active closing peer first closes clcsock")
Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Acked-by: Karsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/20211126024134.45693-1-tonylu@linux.alibaba.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/af_smc.c