提交 bf104589 编写于 作者: C Chenguangli 提交者: Yang Yingliang

scsi/hifc:Fix the bug that the system may be oops during unintall hifc module.

driver inclusion
category: bug
bugzilla: NA

------------------------------------------------------------------

Resolved the issue that the system may be oops due to the resource was released after shutdown
and scsi layer continue send fcp cmd to hifc driver.
Signed-off-by: NChenguangli <chenguangli2@huawei.com>
Reviewed-by: NZengweiliang <zengweiliang.zengweiliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 bc342fb9
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/* B version, B0XX Corresponding x.x */ /* B version, B0XX Corresponding x.x */
#define UNF_B_VERSION "5.0" #define UNF_B_VERSION "5.0"
/* Indicates the minor version number of the driver */ /* Indicates the minor version number of the driver */
#define UNF_DRIVER_VERSION "10" #define UNF_DRIVER_VERSION "11"
/* version num */ /* version num */
#define UNF_FC_VERSION UNF_MAJOR_VERSION "." UNF_B_VERSION "." UNF_DRIVER_VERSION #define UNF_FC_VERSION UNF_MAJOR_VERSION "." UNF_B_VERSION "." UNF_DRIVER_VERSION
extern unsigned int unf_dbg_level; extern unsigned int unf_dbg_level;
......
...@@ -845,6 +845,29 @@ static int unf_scsi_queue_cmd(struct Scsi_Host *shost, ...@@ -845,6 +845,29 @@ static int unf_scsi_queue_cmd(struct Scsi_Host *shost,
return 0; return 0;
} }
if (unlikely(!scsi_image_table->wwn_rport_info_table)) {
UNF_TRACE(UNF_EVTLOG_DRIVER_INFO, UNF_LOG_ABNORMAL, UNF_WARN,
"[warn]Port(0x%x) WwnRportInfoTable NULL", lport->port_id);
cmd->result = DID_NO_CONNECT << 16;
cmd->scsi_done(cmd);
ret_value = DID_NO_CONNECT;
UNF_IO_RESULT_CNT(scsi_image_table, scsi_id, ret_value);
return 0;
}
if (unlikely(lport->b_port_removing == UNF_TRUE)) {
UNF_TRACE(UNF_EVTLOG_DRIVER_INFO, UNF_LOG_ABNORMAL, UNF_WARN,
"[warn]Port(0x%x) scsi_id(0x%x) rport(0x%p) target_id(0x%x) cmd(0x%p) is removing",
lport->port_id, scsi_id, p_rport, p_rport->scsi_target_id, cmd);
cmd->result = DID_NO_CONNECT << 16;
cmd->scsi_done(cmd);
ret_value = DID_NO_CONNECT;
UNF_IO_RESULT_CNT(scsi_image_table, scsi_id, ret_value);
return 0;
}
en_scsi_state = atomic_read(&scsi_image_table->wwn_rport_info_table[scsi_id].en_scsi_state); en_scsi_state = atomic_read(&scsi_image_table->wwn_rport_info_table[scsi_id].en_scsi_state);
if (unlikely(en_scsi_state != UNF_SCSI_ST_ONLINE)) { if (unlikely(en_scsi_state != UNF_SCSI_ST_ONLINE)) {
if (en_scsi_state == UNF_SCSI_ST_OFFLINE) { if (en_scsi_state == UNF_SCSI_ST_OFFLINE) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册