[SCSI] iscsi: redirect fix
authorMike Christie <michaelc@cs.wisc.edu>
Wed, 30 Nov 2005 05:12:49 +0000 (23:12 -0600)
committerJames Bottomley <jejb@mulgrave.(none)>
Wed, 14 Dec 2005 01:11:55 +0000 (18:11 -0700)
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 <michaelc@cs.wisc.edu>
Signed-off-by: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/iscsi_tcp.c

index 0769e948219437af74efd14e42af811d64a73495..f12d605c7729fb26b81001af1924e797b7cc62ae 100644 (file)
@@ -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);
        }