diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2006-08-31 18:09:34 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-09-02 13:37:40 -0500 |
commit | e648f63c6520d6e572573149c16a64d2c5ad7ec5 (patch) | |
tree | 4561ce970213236ec2c3ee732a053a8ae5917e99 /drivers/scsi/libiscsi.c | |
parent | f47f2cf5d4acf929a3aaa6957c3fc4622c358703 (diff) | |
download | lwn-e648f63c6520d6e572573149c16a64d2c5ad7ec5.tar.gz lwn-e648f63c6520d6e572573149c16a64d2c5ad7ec5.zip |
[SCSI] libiscsi: don't call into lld to cleanup task
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>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 12b5c1800740..c542d0e95e68 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -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) @@ -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); } |