Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: libfc: retry PRLI if we cannot analyse the payload

When we fail to analyse the payload of a PRLI response we should reset
the state machine to retry the PRLI; eventually we will be getting a
proper frame. Not doing so will result in a stuck state machine and the
port never to be presented to the systsm.

Suggested-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Arun Easi <arun.easi@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Hannes Reinecke and committed by
Martin K. Petersen
0b4aafc3 aad1271a

+6 -2
+6 -2
drivers/scsi/libfc/fc_rport.c
··· 1161 1161 op = fc_frame_payload_op(fp); 1162 1162 if (op == ELS_LS_ACC) { 1163 1163 pp = fc_frame_payload_get(fp, sizeof(*pp)); 1164 - if (!pp) 1164 + if (!pp) { 1165 + fc_rport_error_retry(rdata, -FC_EX_SEQ_ERR); 1165 1166 goto out; 1167 + } 1166 1168 1167 1169 resp_code = (pp->spp.spp_flags & FC_SPP_RESP_MASK); 1168 1170 FC_RPORT_DBG(rdata, "PRLI spp_flags = 0x%x spp_type 0x%x\n", ··· 1177 1175 fc_rport_error_retry(rdata, -FC_EX_SEQ_ERR); 1178 1176 goto out; 1179 1177 } 1180 - if (pp->prli.prli_spp_len < sizeof(pp->spp)) 1178 + if (pp->prli.prli_spp_len < sizeof(pp->spp)) { 1179 + fc_rport_error_retry(rdata, -FC_EX_SEQ_ERR); 1181 1180 goto out; 1181 + } 1182 1182 1183 1183 fcp_parm = ntohl(pp->spp.spp_params); 1184 1184 if (fcp_parm & FCP_SPPF_RETRY)