From: Mike Christie Date: Wed, 30 Nov 2005 05:12:49 +0000 (-0600) Subject: [SCSI] iscsi: redirect fix X-Git-Tag: v2.6.16-rc1~474^2~22^2~8^2~50 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6273993dbcb8d805dd868e2128c3503a3bb1964;p=linux-2.6 [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 0769e94821..f12d605c77 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); }