Skip to content

Commit 0b4aafc

Browse files
Hannes Reineckemartinkpetersen
authored andcommitted
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>
1 parent aad1271 commit 0b4aafc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/scsi/libfc/fc_rport.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,10 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
11611161
op = fc_frame_payload_op(fp);
11621162
if (op == ELS_LS_ACC) {
11631163
pp = fc_frame_payload_get(fp, sizeof(*pp));
1164-
if (!pp)
1164+
if (!pp) {
1165+
fc_rport_error_retry(rdata, -FC_EX_SEQ_ERR);
11651166
goto out;
1167+
}
11661168

11671169
resp_code = (pp->spp.spp_flags & FC_SPP_RESP_MASK);
11681170
FC_RPORT_DBG(rdata, "PRLI spp_flags = 0x%x spp_type 0x%x\n",
@@ -1175,8 +1177,10 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
11751177
fc_rport_error_retry(rdata, -FC_EX_SEQ_ERR);
11761178
goto out;
11771179
}
1178-
if (pp->prli.prli_spp_len < sizeof(pp->spp))
1180+
if (pp->prli.prli_spp_len < sizeof(pp->spp)) {
1181+
fc_rport_error_retry(rdata, -FC_EX_SEQ_ERR);
11791182
goto out;
1183+
}
11801184

11811185
fcp_parm = ntohl(pp->spp.spp_params);
11821186
if (fcp_parm & FCP_SPPF_RETRY)

0 commit comments

Comments
 (0)