diff options
author | James Smart <james.smart@emulex.com> | 2010-11-20 23:14:19 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 12:23:58 -0600 |
commit | 63e801ce685d151c5faca8f491adc2ad2e732259 (patch) | |
tree | 6cf3db58849160580e4a5c1ce32e4ee14ed6902d /drivers/scsi/lpfc/lpfc_els.c | |
parent | 98db519573e805f9f7e988fb5661da951fcb16b1 (diff) | |
download | linux-63e801ce685d151c5faca8f491adc2ad2e732259.tar.gz linux-63e801ce685d151c5faca8f491adc2ad2e732259.tar.bz2 linux-63e801ce685d151c5faca8f491adc2ad2e732259.zip |
[SCSI] lpfc 8.3.19: Fix critical errors and crashes
Fix critical errors and crashes
- Replace LOF_SECURITY with LOG_SECURITY
- When calculating diag test memory size, use full size with header.
- Return LS_RJT with status=UNSUPPORTED on unrecognized ELS's
- Correct NULL pointer dereference when lpfc_create_vport_work_array()
returns NULL.
- Added code to handle CVL when port is in LPFC_VPORT_FAILED state.
- In lpfc_do_scr_ns_plogi, check the nodelist for FDMI_DID and reuse
the resource.
- Check for generic request 64 and calculate the sgl offset for the request
and reply sgls, also calculate the xmit length using only the request bde.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 884f4d321799..196a7bf905a1 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -6201,7 +6201,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, cmd, did, vport->port_state); /* Unsupported ELS command, reject */ - rjt_err = LSRJT_INVALID_CMD; + rjt_err = LSRJT_CMD_UNSUPPORTED; /* Unknown ELS command <elsCmd> received from NPORT <did> */ lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, @@ -6408,18 +6408,31 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) } if (vport->cfg_fdmi_on) { - ndlp_fdmi = mempool_alloc(phba->nlp_mem_pool, - GFP_KERNEL); + /* If this is the first time, allocate an ndlp and initialize + * it. Otherwise, make sure the node is enabled and then do the + * login. + */ + ndlp_fdmi = lpfc_findnode_did(vport, FDMI_DID); + if (!ndlp_fdmi) { + ndlp_fdmi = mempool_alloc(phba->nlp_mem_pool, + GFP_KERNEL); + if (ndlp_fdmi) { + lpfc_nlp_init(vport, ndlp_fdmi, FDMI_DID); + ndlp_fdmi->nlp_type |= NLP_FABRIC; + } else + return; + } + if (!NLP_CHK_NODE_ACT(ndlp_fdmi)) + ndlp_fdmi = lpfc_enable_node(vport, + ndlp_fdmi, + NLP_STE_NPR_NODE); + if (ndlp_fdmi) { - lpfc_nlp_init(vport, ndlp_fdmi, FDMI_DID); - ndlp_fdmi->nlp_type |= NLP_FABRIC; lpfc_nlp_set_state(vport, ndlp_fdmi, - NLP_STE_PLOGI_ISSUE); - lpfc_issue_els_plogi(vport, ndlp_fdmi->nlp_DID, - 0); + NLP_STE_PLOGI_ISSUE); + lpfc_issue_els_plogi(vport, ndlp_fdmi->nlp_DID, 0); } } - return; } /** |