[stgt] [PATCH] iscsi: avoid adding tm tasks to conn->tx_clist when the conn is closed

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Sat Sep 5 17:04:00 CEST 2009


Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 usr/iscsi/iscsid.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c
index 206a67d..112c92f 100644
--- a/usr/iscsi/iscsid.c
+++ b/usr/iscsi/iscsid.c
@@ -1271,7 +1271,14 @@ static int iscsi_tm_done(struct mgmt_req *mreq)
 {
 	struct iscsi_task *task;
 
-	task = (struct iscsi_task *) (unsigned long) mreq->mid;
+	task = (struct iscsi_task *)(unsigned long)mreq->mid;
+
+	/*
+	 * the connection is closed so we can't put this to
+	 * conn->tx_clist. conn_close() will clean up this task.
+	 */
+	if (task->conn->state == STATE_CLOSE)
+		return 0;
 
 	switch (mreq->result) {
 	case 0:
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list