Merge r6008 from 3.0.x-iser branch

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@6252 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2015-06-11 15:46:00 +00:00
parent 7efd9d336b
commit a97d0be047
2 changed files with 21 additions and 3 deletions

View File

@@ -155,7 +155,11 @@ static int isert_pdu_handle_login_req(struct isert_cmnd *isert_pdu)
static int isert_pdu_handle_text(struct isert_cmnd *pdu)
{
return isert_login_req_rx(&pdu->iscsi);
struct iscsi_cmnd *iscsi_cmnd = &pdu->iscsi;
iscsi_cmnd->sg_cnt = pdu->buf.sg_cnt;
iscsi_cmnd->sg = pdu->buf.sg;
return isert_login_req_rx(iscsi_cmnd);
}
static int isert_pdu_handle_nop_out(struct isert_cmnd *pdu)

View File

@@ -448,7 +448,9 @@ int isert_connection_closed(struct iscsi_conn *iscsi_conn)
dev->state = CS_DISCONNECTED;
if (dev->login_req) {
res = isert_task_abort(dev->login_req);
spin_lock(&dev->pdu_lock);
dev->login_req = NULL;
spin_unlock(&dev->pdu_lock);
}
dev->conn = NULL;
@@ -465,10 +467,19 @@ int isert_connection_closed(struct iscsi_conn *iscsi_conn)
static bool will_read_block(struct isert_conn_dev *dev)
{
bool res;
bool res = true;
spin_lock(&dev->pdu_lock);
res = (dev->login_req == NULL) && (dev->state != CS_DISCONNECTED);
if (dev->login_req != NULL) {
switch (dev->state) {
case CS_REQ_BHS:
case CS_REQ_DATA:
res = false;
break;
default:
;
}
}
spin_unlock(&dev->pdu_lock);
return res;
@@ -697,6 +708,9 @@ static long isert_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
dev->login_rsp->bufflen -= dev->write_len;
if (!last || dev->is_discovery) {
spin_lock(&dev->pdu_lock);
dev->login_req = NULL;
spin_unlock(&dev->pdu_lock);
res = isert_login_rsp_tx(dev->login_rsp,
last,
dev->is_discovery);