diff options
author | James Smart <james.smart@emulex.com> | 2015-04-07 15:07:25 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-10 10:50:03 -0400 |
commit | 6c7cf486d35e0441c81f9bb8c49e6c826028bbb6 (patch) | |
tree | 00e6a95f7c622639208f68ba80722050885c42a5 /drivers/scsi | |
parent | 6eae430328d23e2d6adaa649a7c0bac18e04dda8 (diff) |
lpfc: Fix OS crash when running loopback test in applications
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_bsg.c | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 12 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.h | 1 |
3 files changed, 10 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index 6b4cf315619e..a056666e59d9 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c | |||
@@ -3194,6 +3194,7 @@ lpfc_bsg_diag_loopback_run(struct fc_bsg_job *job) | |||
3194 | cmd->unsli3.rcvsli3.ox_id = 0xffff; | 3194 | cmd->unsli3.rcvsli3.ox_id = 0xffff; |
3195 | } | 3195 | } |
3196 | cmdiocbq->iocb_flag |= LPFC_IO_LIBDFC; | 3196 | cmdiocbq->iocb_flag |= LPFC_IO_LIBDFC; |
3197 | cmdiocbq->iocb_flag |= LPFC_IO_LOOPBACK; | ||
3197 | cmdiocbq->vport = phba->pport; | 3198 | cmdiocbq->vport = phba->pport; |
3198 | cmdiocbq->iocb_cmpl = NULL; | 3199 | cmdiocbq->iocb_cmpl = NULL; |
3199 | iocb_stat = lpfc_sli_issue_iocb_wait(phba, LPFC_ELS_RING, cmdiocbq, | 3200 | iocb_stat = lpfc_sli_issue_iocb_wait(phba, LPFC_ELS_RING, cmdiocbq, |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index c76c2a1e41e4..48919d0e31c7 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -918,12 +918,16 @@ __lpfc_sli_get_sglq(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq) | |||
918 | lpfc_cmd = (struct lpfc_scsi_buf *) piocbq->context1; | 918 | lpfc_cmd = (struct lpfc_scsi_buf *) piocbq->context1; |
919 | ndlp = lpfc_cmd->rdata->pnode; | 919 | ndlp = lpfc_cmd->rdata->pnode; |
920 | } else if ((piocbq->iocb.ulpCommand == CMD_GEN_REQUEST64_CR) && | 920 | } else if ((piocbq->iocb.ulpCommand == CMD_GEN_REQUEST64_CR) && |
921 | !(piocbq->iocb_flag & LPFC_IO_LIBDFC)) | 921 | !(piocbq->iocb_flag & LPFC_IO_LIBDFC)) { |
922 | ndlp = piocbq->context_un.ndlp; | 922 | ndlp = piocbq->context_un.ndlp; |
923 | else if (piocbq->iocb_flag & LPFC_IO_LIBDFC) | 923 | } else if (piocbq->iocb_flag & LPFC_IO_LIBDFC) { |
924 | ndlp = piocbq->context_un.ndlp; | 924 | if (piocbq->iocb_flag & LPFC_IO_LOOPBACK) |
925 | else | 925 | ndlp = NULL; |
926 | else | ||
927 | ndlp = piocbq->context_un.ndlp; | ||
928 | } else { | ||
926 | ndlp = piocbq->context1; | 929 | ndlp = piocbq->context1; |
930 | } | ||
927 | 931 | ||
928 | list_remove_head(lpfc_sgl_list, sglq, struct lpfc_sglq, list); | 932 | list_remove_head(lpfc_sgl_list, sglq, struct lpfc_sglq, list); |
929 | start_sglq = sglq; | 933 | start_sglq = sglq; |
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index 4a01452415cf..e8f9381734d2 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h | |||
@@ -80,6 +80,7 @@ struct lpfc_iocbq { | |||
80 | 80 | ||
81 | #define LPFC_IO_OAS 0x10000 /* OAS FCP IO */ | 81 | #define LPFC_IO_OAS 0x10000 /* OAS FCP IO */ |
82 | #define LPFC_IO_FOF 0x20000 /* FOF FCP IO */ | 82 | #define LPFC_IO_FOF 0x20000 /* FOF FCP IO */ |
83 | #define LPFC_IO_LOOPBACK 0x40000 /* Loopback IO */ | ||
83 | 84 | ||
84 | uint32_t drvrTimeout; /* driver timeout in seconds */ | 85 | uint32_t drvrTimeout; /* driver timeout in seconds */ |
85 | uint32_t fcp_wqidx; /* index to FCP work queue */ | 86 | uint32_t fcp_wqidx; /* index to FCP work queue */ |