mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 03:31:26 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user