Skip to contentSkip to conversation

iscsi: redirect fix

PATCH NAK Mike Christie 1 participant 1 message Nov 30, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/8 iscsi: redirect fix

Quoted 1 line

From [email protected]:

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.

drivers/scsi/iscsi_tcp.c +3 -2
index ae2f7be..6e21798 100644
@@ -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);
 	}