diff options
-rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 7cc084cf9950..981021edfba9 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c | |||
@@ -920,12 +920,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, | |||
920 | * Find or create the sequence. | 920 | * Find or create the sequence. |
921 | */ | 921 | */ |
922 | if (fc_sof_is_init(fr_sof(fp))) { | 922 | if (fc_sof_is_init(fr_sof(fp))) { |
923 | sp = fc_seq_start_next(&ep->seq); | 923 | sp = &ep->seq; |
924 | if (!sp) { | ||
925 | reject = FC_RJT_SEQ_XS; /* exchange shortage */ | ||
926 | goto rel; | ||
927 | } | ||
928 | sp->id = fh->fh_seq_id; | ||
929 | sp->ssb_stat |= SSB_ST_RESP; | 924 | sp->ssb_stat |= SSB_ST_RESP; |
930 | } else { | 925 | } else { |
931 | sp = &ep->seq; | 926 | sp = &ep->seq; |
@@ -1336,17 +1331,14 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) | |||
1336 | goto rel; | 1331 | goto rel; |
1337 | } | 1332 | } |
1338 | sof = fr_sof(fp); | 1333 | sof = fr_sof(fp); |
1339 | if (fc_sof_is_init(sof)) { | 1334 | sp = &ep->seq; |
1340 | sp = fc_seq_start_next(&ep->seq); | 1335 | if (fc_sof_is_init(sof)) |
1341 | sp->id = fh->fh_seq_id; | ||
1342 | sp->ssb_stat |= SSB_ST_RESP; | 1336 | sp->ssb_stat |= SSB_ST_RESP; |
1343 | } else { | 1337 | else if (sp->id != fh->fh_seq_id) { |
1344 | sp = &ep->seq; | ||
1345 | if (sp->id != fh->fh_seq_id) { | ||
1346 | atomic_inc(&mp->stats.seq_not_found); | 1338 | atomic_inc(&mp->stats.seq_not_found); |
1347 | goto rel; | 1339 | goto rel; |
1348 | } | ||
1349 | } | 1340 | } |
1341 | |||
1350 | f_ctl = ntoh24(fh->fh_f_ctl); | 1342 | f_ctl = ntoh24(fh->fh_f_ctl); |
1351 | fr_seq(fp) = sp; | 1343 | fr_seq(fp) = sp; |
1352 | if (f_ctl & FC_FC_SEQ_INIT) | 1344 | if (f_ctl & FC_FC_SEQ_INIT) |
@@ -1763,7 +1755,6 @@ static void fc_exch_els_rec(struct fc_seq *sp, struct fc_frame *rfp) | |||
1763 | fc_exch_done(sp); | 1755 | fc_exch_done(sp); |
1764 | goto out; | 1756 | goto out; |
1765 | } | 1757 | } |
1766 | sp = fc_seq_start_next(sp); | ||
1767 | acc = fc_frame_payload_get(fp, sizeof(*acc)); | 1758 | acc = fc_frame_payload_get(fp, sizeof(*acc)); |
1768 | memset(acc, 0, sizeof(*acc)); | 1759 | memset(acc, 0, sizeof(*acc)); |
1769 | acc->reca_cmd = ELS_LS_ACC; | 1760 | acc->reca_cmd = ELS_LS_ACC; |