diff mbox series

[v3,6/6] scsi: iscsi_tcp: start socket shutdown during conn stop

Message ID 20210424221755.124438-7-michael.christie@oracle.com
State New
Headers show
Series iscsi: Fix in kernel conn failure handling | expand

Commit Message

Mike Christie April 24, 2021, 10:17 p.m. UTC
Make sure the conn socket shutdown starts before we start the timer
to fail commands to upper layers.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/scsi/iscsi_tcp.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Khazhismel Kumykov April 28, 2021, 11:27 p.m. UTC | #1
On Sat, Apr 24, 2021 at 3:18 PM Mike Christie
<michael.christie@oracle.com> wrote:
>

> Make sure the conn socket shutdown starts before we start the timer

> to fail commands to upper layers.

>

> Signed-off-by: Mike Christie <michael.christie@oracle.com>

> ---

>  drivers/scsi/iscsi_tcp.c | 6 ++++++

>  1 file changed, 6 insertions(+)

>

> 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);

> --

> 2.25.1

>


For the series,
Reviewed-by: Khazhismel Kumykov <khazhy@google.com>
Lee Duncan May 6, 2021, 1:29 a.m. UTC | #2
On 4/24/21 3:17 PM, Mike Christie wrote:
> Make sure the conn socket shutdown starts before we start the timer

> to fail commands to upper layers.

> 

> Signed-off-by: Mike Christie <michael.christie@oracle.com>

> ---

>  drivers/scsi/iscsi_tcp.c | 6 ++++++

>  1 file changed, 6 insertions(+)

> 

> 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);

> 


Reviewed-by: Lee Duncan <lduncan@suse.com>
diff mbox series

Patch

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);