linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: vikas.chaudhary@qlogic.com
To: jbottomley@parallels.com, michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, vikas.chaudhary@qlogic.com,
	lalit.chandivade@qlogic.com, ravi.anand@qlogic.com,
	Manish Rangankar <manish.rangankar@qlogic.com>
Subject: [PATCH 3/5] qla4xxx: Fix multiple conn login event issue during session recovery.
Date: Tue,  7 Aug 2012 07:57:15 -0400	[thread overview]
Message-ID: <1344340637-25526-4-git-send-email-vikas.chaudhary@qlogic.com> (raw)
In-Reply-To: <1344340637-25526-1-git-send-email-vikas.chaudhary@qlogic.com>

From: Manish Rangankar <manish.rangankar@qlogic.com>

During iscsid session recovery driver sends multiple ISCSI_CONN_STATE_LOGGED_IN
event from qla4xxx_conn_start() and qla4xxx_ddb_change(), which causes iscsid
to crash.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
 drivers/scsi/qla4xxx/ql4_os.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 77a969a..9c3442d 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -3168,6 +3168,7 @@ int qla4xxx_unblock_ddb(struct iscsi_cls_session *cls_session)
 	struct iscsi_session *sess;
 	struct ddb_entry *ddb_entry;
 	struct scsi_qla_host *ha;
+	int status = QLA_SUCCESS;
 
 	sess = cls_session->dd_data;
 	ddb_entry = sess->dd_data;
@@ -3175,11 +3176,20 @@ int qla4xxx_unblock_ddb(struct iscsi_cls_session *cls_session)
 	ql4_printk(KERN_INFO, ha, "scsi%ld: %s: ddb[%d]"
 		   " unblock user space session\n", ha->host_no, __func__,
 		   ddb_entry->fw_ddb_index);
-	iscsi_conn_start(ddb_entry->conn);
-	iscsi_conn_login_event(ddb_entry->conn,
-			       ISCSI_CONN_STATE_LOGGED_IN);
 
-	return QLA_SUCCESS;
+	if (!iscsi_is_session_online(cls_session)) {
+		iscsi_conn_start(ddb_entry->conn);
+		iscsi_conn_login_event(ddb_entry->conn,
+				       ISCSI_CONN_STATE_LOGGED_IN);
+	} else {
+		ql4_printk(KERN_INFO, ha,
+			   "scsi%ld: %s: ddb[%d] session [%d] already logged in\n",
+			   ha->host_no, __func__, ddb_entry->fw_ddb_index,
+			   cls_session->sid);
+		status = QLA_ERROR;
+	}
+
+	return status;
 }
 
 static void qla4xxx_relogin_all_devices(struct scsi_qla_host *ha)
-- 
1.7.8.GIT


  parent reply	other threads:[~2012-08-07 12:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07 11:57 [PATCH 0/5] qla4xxx: Updates for scsi "misc" branch vikas.chaudhary
2012-08-07 11:57 ` [PATCH 1/5] qla4xxx: Fix memory corruption issue in qla4xxx_ep_connect vikas.chaudhary
2012-08-07 11:57 ` [PATCH 2/5] qla4xxx: Fix gcc warning for x86 system vikas.chaudhary
2012-08-07 11:57 ` vikas.chaudhary [this message]
2012-08-07 11:57 ` [PATCH 4/5] qla4xxx: Properly handle SCSI underrun while processing status IOCBs vikas.chaudhary
2012-08-07 11:57 ` [PATCH 5/5] qla4xxx: Update driver version to 5.02.00-k19 vikas.chaudhary
2012-08-07 16:52 ` [PATCH 0/5] qla4xxx: Updates for scsi "misc" branch Mike Christie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344340637-25526-4-git-send-email-vikas.chaudhary@qlogic.com \
    --to=vikas.chaudhary@qlogic.com \
    --cc=jbottomley@parallels.com \
    --cc=lalit.chandivade@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=manish.rangankar@qlogic.com \
    --cc=michaelc@cs.wisc.edu \
    --cc=ravi.anand@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).