From: Mike Christie Date: Wed, 30 Nov 2005 05:12:49 +0000 (-0600) Subject: [SCSI] iscsi: redirect fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e6273993dbcb8d805dd868e2128c3503a3bb1964;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [SCSI] iscsi: redirect fix From tomof@acm.org: There is one more issue about Equallogic systems. They send re-direction info with FIN. I think that the kernel module needs to let iscsid to read data from the socket before killing it. Signed-off-by: Mike Christie Signed-off-by: Alex Aizman Signed-off-by: Dmitry Yusupov Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 0769e9482194..f12d605c7729 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -1237,8 +1237,9 @@ iscsi_tcp_state_change(struct sock *sk) conn = (struct iscsi_conn*)sk->sk_user_data; session = conn->session; - if (sk->sk_state == TCP_CLOSE_WAIT || - sk->sk_state == TCP_CLOSE) { + if ((sk->sk_state == TCP_CLOSE_WAIT || + sk->sk_state == TCP_CLOSE) && + !atomic_read(&sk->sk_rmem_alloc)) { debug_tcp("iscsi_tcp_state_change: TCP_CLOSE|TCP_CLOSE_WAIT\n"); iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); }