aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2014-09-03 12:58:16 -0400
committerChristoph Hellwig <hch@lst.de>2014-09-16 12:10:13 -0400
commit8c50d25c0edd8ec05a7e069c23f6ac2e50c898b1 (patch)
tree55ad0815ae4a846ec32776ef69057be742f0a408
parenteb01656688edd686a80c89281043fe6f2b2af6ff (diff)
lpfc: fix for handling unmapped ndlp in target reset handler
Fix for handling unmapped ndlp in target reset handler Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c8
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 0f6be8560508..b99399fe2548 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5339,7 +5339,13 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
5339 if (status == FAILED) { 5339 if (status == FAILED) {
5340 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, 5340 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5341 "0722 Target Reset rport failure: rdata x%p\n", rdata); 5341 "0722 Target Reset rport failure: rdata x%p\n", rdata);
5342 return FAILED; 5342 spin_lock_irq(shost->host_lock);
5343 pnode->nlp_flag &= ~NLP_NPR_ADISC;
5344 pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE;
5345 spin_unlock_irq(shost->host_lock);
5346 lpfc_reset_flush_io_context(vport, tgt_id, lun_id,
5347 LPFC_CTX_TGT);
5348 return FAST_IO_FAIL;
5343 } 5349 }
5344 5350
5345 scsi_event.event_type = FC_REG_SCSI_EVENT; 5351 scsi_event.event_type = FC_REG_SCSI_EVENT;
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index cea89c6ce1d6..207a43d952fa 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -10132,7 +10132,9 @@ lpfc_sli_abort_taskmgmt(struct lpfc_vport *vport, struct lpfc_sli_ring *pring,
10132 uint16_t tgt_id, uint64_t lun_id, lpfc_ctx_cmd cmd) 10132 uint16_t tgt_id, uint64_t lun_id, lpfc_ctx_cmd cmd)
10133{ 10133{
10134 struct lpfc_hba *phba = vport->phba; 10134 struct lpfc_hba *phba = vport->phba;
10135 struct lpfc_scsi_buf *lpfc_cmd;
10135 struct lpfc_iocbq *abtsiocbq; 10136 struct lpfc_iocbq *abtsiocbq;
10137 struct lpfc_nodelist *ndlp;
10136 struct lpfc_iocbq *iocbq; 10138 struct lpfc_iocbq *iocbq;
10137 IOCB_t *icmd; 10139 IOCB_t *icmd;
10138 int sum, i, ret_val; 10140 int sum, i, ret_val;
@@ -10187,7 +10189,11 @@ lpfc_sli_abort_taskmgmt(struct lpfc_vport *vport, struct lpfc_sli_ring *pring,
10187 if (iocbq->iocb_flag & LPFC_IO_FOF) 10189 if (iocbq->iocb_flag & LPFC_IO_FOF)
10188 abtsiocbq->iocb_flag |= LPFC_IO_FOF; 10190 abtsiocbq->iocb_flag |= LPFC_IO_FOF;
10189 10191
10190 if (lpfc_is_link_up(phba)) 10192 lpfc_cmd = container_of(iocbq, struct lpfc_scsi_buf, cur_iocbq);
10193 ndlp = lpfc_cmd->rdata->pnode;
10194
10195 if (lpfc_is_link_up(phba) &&
10196 (ndlp && ndlp->nlp_state == NLP_STE_MAPPED_NODE))
10191 abtsiocbq->iocb.ulpCommand = CMD_ABORT_XRI_CN; 10197 abtsiocbq->iocb.ulpCommand = CMD_ABORT_XRI_CN;
10192 else 10198 else
10193 abtsiocbq->iocb.ulpCommand = CMD_CLOSE_XRI_CN; 10199 abtsiocbq->iocb.ulpCommand = CMD_CLOSE_XRI_CN;