]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: Keep smc_close_final rc during active close
authorTony Lu <tonylu@linux.alibaba.com>
Wed, 1 Dec 2021 06:42:16 +0000 (14:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Dec 2021 12:14:36 +0000 (12:14 +0000)
commit99657db029803a64875e28c0703aeec2a9cbd042
tree48c63395f75af2a46c3880ea0dd977d2719825fb
parenta309647f88f340315dc927716697829a130bef12
net/smc: Keep smc_close_final rc during active close

When smc_close_final() returns error, the return code overwrites by
kernel_sock_shutdown() in smc_close_active(). The return code of
smc_close_final() is more important than kernel_sock_shutdown(), and it
will pass to userspace directly.

Fix it by keeping both return codes, if smc_close_final() raises an
error, return it or kernel_sock_shutdown()'s.

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")
Suggested-by: Karsten Graul <kgraul@linux.ibm.com>
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_close.c