summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2021-05-25 21:18:02 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-06-02 08:28:20 +0300
commit788b71c54f21fd994071c77983fdf1a9c264fc95 (patch)
tree2e12cf8b653c3bc78d6a2bbd7c16b8622703fce2
parentc0920cd36f17f0729927b33009ca586be50e3d9b (diff)
downloadlinux-788b71c54f21fd994071c77983fdf1a9c264fc95.tar.xz
scsi: iscsi: iscsi_tcp: Start socket shutdown during conn stop
Make sure the conn socket shutdown starts before we start the timer to fail commands to upper layers. Link: https://lore.kernel.org/r/20210525181821.7617-10-michael.christie@oracle.com Reviewed-by: Lee Duncan <lduncan@suse.com> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/iscsi_tcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 553e95ad6197..1bc37593c88f 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -600,6 +600,12 @@ static void iscsi_sw_tcp_release_conn(struct iscsi_conn *conn)
if (!sock)
return;
+ /*
+ * Make sure we start socket shutdown now in case userspace is up
+ * but delayed in releasing the socket.
+ */
+ kernel_sock_shutdown(sock, SHUT_RDWR);
+
sock_hold(sock->sk);
iscsi_sw_tcp_conn_restore_callbacks(conn);
sock_put(sock->sk);