[SCSI] iscsi: increment expstatsn during login

debugged by Ming and Rohan:

The problem Ming and Rohan debugged was that during a normal session
login, open-iscsi is not incrementing the exp_statsn counter. It was
stuck at zero. From the RFC, it looks like if the login response PDU has
a successful status then we should be incrementing that value. Also from
the RFC, it looks like if when we drop a connection then reconnect, we
should be using the exp_statsn from the old connection in the next
relogin attempt.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
Mike Christie
2006-05-02 19:46:47 -05:00
committed by James Bottomley
parent be2df72e7e
commit 8d2860b3c3
4 changed files with 32 additions and 21 deletions

View File

@ -2298,6 +2298,9 @@ iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
BUG_ON(value);
session->ofmarker_en = value;
break;
case ISCSI_PARAM_EXP_STATSN:
conn->exp_statsn = value;
break;
default:
break;
}
@ -2381,6 +2384,9 @@ iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
inet = inet_sk(tcp_conn->sock->sk);
*value = be16_to_cpu(inet->dport);
mutex_unlock(&conn->xmitmutex);
case ISCSI_PARAM_EXP_STATSN:
*value = conn->exp_statsn;
break;
default:
return -EINVAL;
}
@ -2548,7 +2554,8 @@ static struct iscsi_transport iscsi_tcp_transport = {
ISCSI_DATASEQ_INORDER_EN |
ISCSI_ERL |
ISCSI_CONN_PORT |
ISCSI_CONN_ADDRESS,
ISCSI_CONN_ADDRESS |
ISCSI_EXP_STATSN,
.host_template = &iscsi_sht,
.conndata_size = sizeof(struct iscsi_conn),
.max_conn = 1,