Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35025
b: refs/heads/master
c: f47f2cf
h: refs/heads/master
i:
  35023: 533f32e
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Sep 2, 2006
1 parent 52188db commit e25744d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 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: ca5186842a6d85e982e3d572ecd407453d0c5116
refs/heads/master: f47f2cf5d4acf929a3aaa6957c3fc4622c358703
27 changes: 22 additions & 5 deletions trunk/drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ static void iscsi_complete_command(struct iscsi_cmd_task *ctask)

ctask->state = ISCSI_TASK_COMPLETED;
ctask->sc = NULL;
/* SCSI eh reuses commands to verify us */
sc->SCp.ptr = NULL;
list_del_init(&ctask->running);
__kfifo_put(session->cmdpool.queue, (void*)&ctask, sizeof(void*));
sc->scsi_done(sc);
Expand Down Expand Up @@ -737,6 +739,7 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))

sc->scsi_done = done;
sc->result = 0;
sc->SCp.ptr = NULL;

host = sc->device->host;
session = iscsi_hostdata(host->hostdata);
Expand Down Expand Up @@ -801,9 +804,10 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))

list_add_tail(&ctask->running, &conn->xmitqueue);
debug_scsi(
"ctask enq [%s cid %d sc %lx itt 0x%x len %d cmdsn %d win %d]\n",
"ctask enq [%s cid %d sc %p cdb 0x%x itt 0x%x len %d cmdsn %d "
"win %d]\n",
sc->sc_data_direction == DMA_TO_DEVICE ? "write" : "read",
conn->id, (long)sc, ctask->itt, sc->request_bufflen,
conn->id, sc, sc->cmnd[0], ctask->itt, sc->request_bufflen,
session->cmdsn, session->max_cmdsn - session->exp_cmdsn + 1);
spin_unlock(&session->lock);

Expand Down Expand Up @@ -1134,11 +1138,24 @@ static void fail_command(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,

int iscsi_eh_abort(struct scsi_cmnd *sc)
{
struct iscsi_cmd_task *ctask = (struct iscsi_cmd_task *)sc->SCp.ptr;
struct iscsi_conn *conn = ctask->conn;
struct iscsi_session *session = conn->session;
struct iscsi_cmd_task *ctask;
struct iscsi_conn *conn;
struct iscsi_session *session;
int rc;

/*
* if session was ISCSI_STATE_IN_RECOVERY then we may not have
* got the command.
*/
if (!sc->SCp.ptr) {
debug_scsi("sc never reached iscsi layer or it completed.\n");
return SUCCESS;
}

ctask = (struct iscsi_cmd_task *)sc->SCp.ptr;
conn = ctask->conn;
session = conn->session;

conn->eh_abort_cnt++;
debug_scsi("aborting [sc %p itt 0x%x]\n", sc, ctask->itt);

Expand Down

0 comments on commit e25744d

Please sign in to comment.