aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/iscsi_tcp.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2006-05-30 01:37:20 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-05 19:10:45 -0400
commit67a611149b2ac5f4af1e36bfffbfe3198cd3712c (patch)
treef74b70aefc16544901a3a3191bee8be8c467747d /drivers/scsi/iscsi_tcp.c
parent9bf0a28c9a24e2cee5deecf89d118254374c75ba (diff)
[SCSI] iscsi: don't 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. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/iscsi_tcp.c')
-rw-r--r--drivers/scsi/iscsi_tcp.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index c66faee07ca..2abda804a92 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -1955,30 +1955,28 @@ iscsi_tcp_conn_bind(struct iscsi_cls_session *cls_session,
1955 if (err) 1955 if (err)
1956 return err; 1956 return err;
1957 1957
1958 if (conn->stop_stage != STOP_CONN_SUSPEND) { 1958 /* bind iSCSI connection and socket */
1959 /* bind iSCSI connection and socket */ 1959 tcp_conn->sock = sock;
1960 tcp_conn->sock = sock;
1961 1960
1962 /* setup Socket parameters */ 1961 /* setup Socket parameters */
1963 sk = sock->sk; 1962 sk = sock->sk;
1964 sk->sk_reuse = 1; 1963 sk->sk_reuse = 1;
1965 sk->sk_sndtimeo = 15 * HZ; /* FIXME: make it configurable */ 1964 sk->sk_sndtimeo = 15 * HZ; /* FIXME: make it configurable */
1966 sk->sk_allocation = GFP_ATOMIC; 1965 sk->sk_allocation = GFP_ATOMIC;
1967 1966
1968 /* FIXME: disable Nagle's algorithm */ 1967 /* FIXME: disable Nagle's algorithm */
1969 1968
1970 /* 1969 /*
1971 * Intercept TCP callbacks for sendfile like receive 1970 * Intercept TCP callbacks for sendfile like receive
1972 * processing. 1971 * processing.
1973 */ 1972 */
1974 conn->recv_lock = &sk->sk_callback_lock; 1973 conn->recv_lock = &sk->sk_callback_lock;
1975 iscsi_conn_set_callbacks(conn); 1974 iscsi_conn_set_callbacks(conn);
1976 tcp_conn->sendpage = tcp_conn->sock->ops->sendpage; 1975 tcp_conn->sendpage = tcp_conn->sock->ops->sendpage;
1977 /* 1976 /*
1978 * set receive state machine into initial state 1977 * set receive state machine into initial state
1979 */ 1978 */
1980 tcp_conn->in_progress = IN_PROGRESS_WAIT_HEADER; 1979 tcp_conn->in_progress = IN_PROGRESS_WAIT_HEADER;
1981 }
1982 1980
1983 return 0; 1981 return 0;
1984} 1982}