Skip to content

Commit

Permalink
[SCSI] libiscsi: fix null ptr regression when aborting a command with…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Mike Christie authored and James Bottomley committed Aug 15, 2007
1 parent 604cd79 commit 96809f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,19 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
*/
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;
Expand Down

0 comments on commit 96809f1

Please sign in to comment.