Skip to content

Commit

Permalink
scsi: iscsi: iscsi_tcp: Start socket shutdown during conn stop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Christie authored and Martin K. Petersen committed Jun 2, 2021
1 parent c0920cd commit 788b71c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 788b71c

Please sign in to comment.