Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e648f63c authored by Mike Christie's avatar Mike Christie Committed by James Bottomley
Browse files

[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: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent f47f2cf5
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -213,13 +213,9 @@ 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);
}