summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2007-08-15 01:38:29 -0500
committerJames Bottomley <jejb@mulgrave.localdomain>2007-08-15 13:08:14 -0500
commit96809f1b15eddae2325b2ab78e6f931edc969074 (patch)
treedc260207b281e0f078f7b560a178565968109383
parent604cd794de3094ccf8a9c149f299237a642ba9b5 (diff)
downloadop-kernel-dev-96809f1b15eddae2325b2ab78e6f931edc969074.zip
op-kernel-dev-96809f1b15eddae2325b2ab78e6f931edc969074.tar.gz
[SCSI] libiscsi: fix null ptr regression when aborting a command with data to transfer
We do not want to send data if we are aborting a task. There is a check in iscsi_xmit_ctask, but right before calling this we overwrite the state so we always go right past the test. Sending data causes problems because when we clean up from a successful abort the LLD assumes that the task is not running. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/scsi/libiscsi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5606d1e..f5915d4 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -737,12 +737,19 @@ check_mgmt:
*/
conn->ctask = list_entry(conn->xmitqueue.next,
struct iscsi_cmd_task, running);
- if (conn->ctask->state == ISCSI_TASK_PENDING) {
+ switch (conn->ctask->state) {
+ case ISCSI_TASK_ABORTING:
+ break;
+ case ISCSI_TASK_PENDING:
iscsi_prep_scsi_cmd_pdu(conn->ctask);
conn->session->tt->init_cmd_task(conn->ctask);
+ /* fall through */
+ default:
+ conn->ctask->state = ISCSI_TASK_RUNNING;
+ break;
}
- conn->ctask->state = ISCSI_TASK_RUNNING;
list_move_tail(conn->xmitqueue.next, &conn->run_list);
+
rc = iscsi_xmit_ctask(conn);
if (rc)
goto again;
OpenPOWER on IntegriCloud