Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204275
b: refs/heads/master
c: 7f98523
h: refs/heads/master
i:
  204273: 8e68172
  204271: 11bc9e7
v: v3
  • Loading branch information
Bhanu Prakash Gollapudi authored and James Bottomley committed Jul 28, 2010
1 parent 7c00c4b commit d084081
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf4aebcafb44a8810af10006dd4a5fcfb07bb810
refs/heads/master: 7f985231d274ef3e6e4d56a2939a534906299021
63 changes: 27 additions & 36 deletions trunk/drivers/scsi/libfc/fc_lport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,38 +1012,24 @@ static void fc_lport_error(struct fc_lport *lport, struct fc_frame *fp)
PTR_ERR(fp), fc_lport_state(lport),
lport->retry_count);

if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) {
/*
* Memory allocation failure, or the exchange timed out.
* Retry after delay
*/
if (lport->retry_count < lport->max_retry_count) {
lport->retry_count++;
if (!fp)
delay = msecs_to_jiffies(500);
else
delay = msecs_to_jiffies(lport->e_d_tov);

schedule_delayed_work(&lport->retry_work, delay);
} else {
switch (lport->state) {
case LPORT_ST_DISABLED:
case LPORT_ST_READY:
case LPORT_ST_RESET:
case LPORT_ST_RNN_ID:
case LPORT_ST_RSNN_NN:
case LPORT_ST_RSPN_ID:
case LPORT_ST_RFT_ID:
case LPORT_ST_RFF_ID:
case LPORT_ST_SCR:
case LPORT_ST_DNS:
case LPORT_ST_FLOGI:
case LPORT_ST_LOGO:
fc_lport_enter_reset(lport);
break;
}
}
}
if (PTR_ERR(fp) == -FC_EX_CLOSED)
return;

/*
* Memory allocation failure, or the exchange timed out
* or we received LS_RJT.
* Retry after delay
*/
if (lport->retry_count < lport->max_retry_count) {
lport->retry_count++;
if (!fp)
delay = msecs_to_jiffies(500);
else
delay = msecs_to_jiffies(lport->e_d_tov);

schedule_delayed_work(&lport->retry_work, delay);
} else
fc_lport_enter_reset(lport);
}

/**
Expand Down Expand Up @@ -1461,7 +1447,13 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
}

did = fc_frame_did(fp);
if (fc_frame_payload_op(fp) == ELS_LS_ACC && did != 0) {

if (!did) {
FC_LPORT_DBG(lport, "Bad FLOGI response\n");
goto out;
}

if (fc_frame_payload_op(fp) == ELS_LS_ACC) {
flp = fc_frame_payload_get(fp, sizeof(*flp));
if (flp) {
mfs = ntohs(flp->fl_csp.sp_bb_data) &
Expand Down Expand Up @@ -1500,9 +1492,8 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
fc_lport_enter_dns(lport);
}
}
} else {
FC_LPORT_DBG(lport, "Bad FLOGI response\n");
}
} else
fc_lport_error(lport, fp);

out:
fc_frame_free(fp);
Expand Down

0 comments on commit d084081

Please sign in to comment.