Skip to contentSkip to conversation

iscsi update: dont switch states when just cleaning up

PATCH In review Mike Christie 1 participant 1 message May 30, 2006

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

PATCH 1/5 iscsi update: dont switch states when just cleaning up

If recovery failed or we are in recovery only overwrite the state if we are going to terminate the session or if we logged back in.

STOP_CONN_SUSPEND and conn_cnt are not used. We only support a single connection session ATM, so cleanup that code while we are working around it.

drivers/scsi/iscsi_tcp.c +20 -22
index c66faee..2abda80 100644
@@ -1955,30 +1955,28 @@ iscsi_tcp_conn_bind(struct iscsi_cls_ses
 	if (err)
 		return err;
 
-	if (conn->stop_stage != STOP_CONN_SUSPEND) {
-		/* bind iSCSI connection and socket */
-		tcp_conn->sock = sock;
-
-		/* setup Socket parameters */
-		sk = sock->sk;
-		sk->sk_reuse = 1;
-		sk->sk_sndtimeo = 15 * HZ; /* FIXME: make it configurable */
-		sk->sk_allocation = GFP_ATOMIC;
+	/* bind iSCSI connection and socket */
+	tcp_conn->sock = sock;
 
-		/* FIXME: disable Nagle's algorithm */
+	/* setup Socket parameters */
+	sk = sock->sk;
+	sk->sk_reuse = 1;
+	sk->sk_sndtimeo = 15 * HZ; /* FIXME: make it configurable */
+	sk->sk_allocation = GFP_ATOMIC;
 
-		/*
-		 * Intercept TCP callbacks for sendfile like receive
-		 * processing.
-		 */
-		conn->recv_lock = &sk->sk_callback_lock;
-		iscsi_conn_set_callbacks(conn);
-		tcp_conn->sendpage = tcp_conn->sock->ops->sendpage;
-		/*
-		 * set receive state machine into initial state
-		 */
-		tcp_conn->in_progress = IN_PROGRESS_WAIT_HEADER;
-	}
+	/* FIXME: disable Nagle's algorithm */
+
+	/*
+	 * Intercept TCP callbacks for sendfile like receive
+	 * processing.
+	 */
+	conn->recv_lock = &sk->sk_callback_lock;
+	iscsi_conn_set_callbacks(conn);
+	tcp_conn->sendpage = tcp_conn->sock->ops->sendpage;
+	/*
+	 * set receive state machine into initial state
+	 */
+	tcp_conn->in_progress = IN_PROGRESS_WAIT_HEADER;
 
 	return 0;
 }
drivers/scsi/libiscsi.c +14 -41

117 lines not on this page · raw message

include/scsi/libiscsi.h +0 -1
index 17b28f0..cbf7e58 100644
@@ -211,7 +211,6 @@ struct iscsi_session {
 						 * - r2tpool		   */
 	int			state;		/* session state           */
 	struct list_head	item;
-	int			conn_cnt;
 	int			age;		/* counts session re-opens */
 
 	struct list_head	connections;	/* list of connections */