[SCSI] qla4xxx: Fix kernel panic during discovery logout.
authorManish Rangankar <manish.rangankar@qlogic.com>
Tue, 24 Apr 2012 05:32:33 +0000 (22:32 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 30 May 2012 08:56:08 +0000 (12:56 +0400)
Update the session and connection parameter before sending
connection logged in event to iscsiadm because in some
scenario logout may come in just after we send the logged
in event to user, which free up session, connection and ddb,
but DPC is still updating session and connect parameter
which can lead to panic.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/qla4xxx/ql4_init.c

index 90ee5d8fa7315eda08a8bdc9cd8b66aff2e82eb2..05484364010e756da304426a8961f5f22cdd9ac5 100644 (file)
@@ -884,8 +884,8 @@ int qla4xxx_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
                switch (state) {
                case DDB_DS_SESSION_ACTIVE:
                case DDB_DS_DISCOVERY:
-                       ddb_entry->unblock_sess(ddb_entry->sess);
                        qla4xxx_update_session_conn_param(ha, ddb_entry);
+                       ddb_entry->unblock_sess(ddb_entry->sess);
                        status = QLA_SUCCESS;
                        break;
                case DDB_DS_SESSION_FAILED:
@@ -897,6 +897,7 @@ int qla4xxx_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
                }
                break;
        case DDB_DS_SESSION_ACTIVE:
+       case DDB_DS_DISCOVERY:
                switch (state) {
                case DDB_DS_SESSION_FAILED:
                        /*