Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161112
b: refs/heads/master
c: 70b31c1
h: refs/heads/master
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Sep 5, 2009
1 parent 166867a commit 039c4ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d1af8a328755f51c9b76157a8692e56520d3fd94
refs/heads/master: 70b31c152dc49ef70bd2b34ad53ccbd9bb4116d4
19 changes: 10 additions & 9 deletions trunk/drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,9 @@ static int iscsi_xmit_task(struct iscsi_conn *conn)
struct iscsi_task *task = conn->task;
int rc;

if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx))
return -ENODATA;

__iscsi_get_task(task);
spin_unlock_bh(&conn->session->lock);
rc = conn->session->tt->xmit_task(task);
Expand Down Expand Up @@ -1329,7 +1332,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
int rc = 0;

spin_lock_bh(&conn->session->lock);
if (unlikely(conn->suspend_tx)) {
if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) {
ISCSI_DBG_SESSION(conn->session, "Tx suspended!\n");
spin_unlock_bh(&conn->session->lock);
return -ENODATA;
Expand All @@ -1338,7 +1341,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
if (conn->task) {
rc = iscsi_xmit_task(conn);
if (rc)
goto again;
goto done;
}

/*
Expand All @@ -1358,7 +1361,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
}
rc = iscsi_xmit_task(conn);
if (rc)
goto again;
goto done;
}

/* process pending command queue */
Expand All @@ -1379,14 +1382,14 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
list_add_tail(&conn->task->running,
&conn->cmdqueue);
conn->task = NULL;
goto again;
goto done;
} else
fail_scsi_task(conn->task, DID_ABORT);
continue;
}
rc = iscsi_xmit_task(conn);
if (rc)
goto again;
goto done;
/*
* we could continuously get new task requests so
* we need to check the mgmt queue for nops that need to
Expand All @@ -1412,16 +1415,14 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
conn->task->state = ISCSI_TASK_RUNNING;
rc = iscsi_xmit_task(conn);
if (rc)
goto again;
goto done;
if (!list_empty(&conn->mgmtqueue))
goto check_mgmt;
}
spin_unlock_bh(&conn->session->lock);
return -ENODATA;

again:
if (unlikely(conn->suspend_tx))
rc = -ENODATA;
done:
spin_unlock_bh(&conn->session->lock);
return rc;
}
Expand Down

0 comments on commit 039c4ea

Please sign in to comment.