Skip to content

Commit

Permalink
[SCSI] libiscsi: don't call into lld to cleanup task
Browse files Browse the repository at this point in the history
In the normal IO path we should not be calling back
into the LLD since the LLD will have cleaned up the
task before or after calling complete pdu.

For the fail_command path we still need to do this
to force the cleanup.

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 Sep 2, 2006
1 parent f47f2cf commit e648f63
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,8 @@ static void iscsi_get_ctask(struct iscsi_cmd_task *ctask)

static void __iscsi_put_ctask(struct iscsi_cmd_task *ctask)
{
struct iscsi_conn *conn = ctask->conn;

if (atomic_dec_and_test(&ctask->refcount)) {
conn->session->tt->cleanup_cmd_task(conn, ctask);
if (atomic_dec_and_test(&ctask->refcount))
iscsi_complete_command(ctask);
}
}

static void iscsi_put_ctask(struct iscsi_cmd_task *ctask)
Expand Down Expand Up @@ -1129,10 +1125,13 @@ static void fail_command(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,
sc = ctask->sc;
if (!sc)
return;

conn->session->tt->cleanup_cmd_task(conn, ctask);
iscsi_ctask_mtask_cleanup(ctask);

sc->result = err;
sc->resid = sc->request_bufflen;
/* release ref from queuecommand */
__iscsi_put_ctask(ctask);
}

Expand Down

0 comments on commit e648f63

Please sign in to comment.