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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux