Hannes Reinecke wrote:
> For multipathing we should ensure to return a DID_TRANSPORT_XX
> result code whenever applicable; this will ensure a fast failover
> to other paths if this one is temporarily out of order.
> 
> Signed-off-by: Hannes Reinecke <h...@suse.de>
> ---
>  drivers/scsi/libiscsi.c |   11 ++++-------
>  1 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index 716cc34..fc10544 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -1429,12 +1429,6 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void 
> (*done)(struct scsi_cmnd *))
>       session = cls_session->dd_data;
>       spin_lock(&session->lock);
>  
> -     reason = iscsi_session_chkready(cls_session);
> -     if (reason) {
> -             sc->result = reason;
> -             goto fault;
> -     }
> -
>       if (session->state != ISCSI_STATE_LOGGED_IN) {
>               /*
>                * to handle the race between when we set the recovery state
> @@ -1444,6 +1438,9 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void 
> (*done)(struct scsi_cmnd *))
>                */
>               switch (session->state) {
>               case ISCSI_STATE_FAILED:
> +                     reason = FAILURE_SESSION_FAILED;
> +                     sc->result = DID_TRANSPORT_DISRUPTED << 16;
> +                     break;

This probably speeds up the failover time by accident because the 
retries/allowed counter/check hits zero before the 
replacement_timeout/recovery_timeout (fast io fail in fc class terms) 
timer has fired.

This can be in the failed state for a couple seconds while we 
transistion the sdevs to blocked. At this time we do not want the 
retries to be decremented.



>               case ISCSI_STATE_IN_RECOVERY:
>                       reason = FAILURE_SESSION_IN_RECOVERY;
>                       sc->result = DID_IMM_RETRY << 16;
> @@ -1462,7 +1459,7 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void 
> (*done)(struct scsi_cmnd *))
>                       break;
>               default:
>                       reason = FAILURE_SESSION_FREED;
> -                     sc->result = DID_NO_CONNECT << 16;
> +                     sc->result = DID_TRANSPORT_FAILFAST << 16;

I am not sure why you are changing this one. When are you hitting it? 
What is the session->state.


>               }
>               goto fault;
>       }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to