Vasu Dev wrote:
> If no response to abort request then fc_exch_timeout() will
> occur in ESB_ST_ABNORMAL, in this state
>
> 1. we need to free exchanges for non fcp upper layers
> 2. Call fcp layer exch resp to allow exch done from fcp
>
> /*
> * Internal version of fc_exch_timer_set - used with lock held.
> */
> @@ -399,6 +439,7 @@ static void fc_exch_timeout(unsigned long ep_arg)
> void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg);
> void *arg;
> u32 e_stat;
> + int rc = 1;
>
> spin_lock_bh(&ep->ex_lock);
> if (ep->state & (FC_EX_RST_CLEANUP | FC_EX_DONE))
> @@ -411,16 +452,21 @@ static void fc_exch_timeout(unsigned long ep_arg)
> if (e_stat & ESB_ST_REC_QUAL)
> fc_exch_rrq(ep);
> goto done;
> - } else if (!(e_stat & ESB_ST_ABNORMAL)) {
> + } else {
> resp = ep->resp;
> arg = ep->resp_arg;
> /*
> * For FCP commands fc_fcp.c will manage the completion.
> * For all others fc_exch.c will handle.
> */
> - if (ep->fh_type != FC_TYPE_FCP)
> + if (ep->fh_type != FC_TYPE_FCP) {
> ep->resp = NULL;
> + if (e_stat & ESB_ST_ABNORMAL)
> + rc = fc_exch_done_locked(ep);
> + }
> spin_unlock_bh(&ep->ex_lock);
> + if (!rc)
> + fc_exch_mgr_delete_ep(ep);
> if (resp)
> resp(sp, ERR_PTR(-FC_EX_TIMEOUT), arg);
If we do this then we need to add back -FC_EX_TIMEOUT handling to
fc_fcp_error. And as side note it looks like for fc_fcp_rec_error we
need to move the "default:" in the switch to after the -FC_EX_TIMEOUT
timeout handling (fc_fcp_rec sets a timeout so it seems like it is ok
for it to get a timeout).
In my patch I dropped my -FC_EX_TIMEOUT handling in fc_fcp_error because
you noticed we could not hit it before. The calls to exch_seq_send and
to seq_send for the SCSI command and lun reset do not set a timeout, so
the above code would not be called normally. However, when
fc_fcp_send_abort calls tt.seq_exch_abort the fc_exch abort code sets
the ep timer. So we can hit the above code if the abort for the scsi
command timesout. And in that case we do not always want to do what
fc_fcp_error is doing today where it just completes the command. If
scsi-ml were going to escalate the eh then it would be ok, but if the
abort was initiated from the normal IO path then it might not be safe.
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel