Skip to content

Commit

Permalink
scsi_transport_srp: Reduce failover time
Browse files Browse the repository at this point in the history
Unlike FC, there is no risk that SCSI devices will be offlined
by the SCSI error handler if the SCSI error handler is started
while a reconnect attempt is ongoing. Hence report timeout errors
as soon as possible if a higher software layer (e.g. multipathd)
needs to be informed about a timeout. It is assumed that if both
fast_io_fail_tmo < 0 and rport->dev_loss_tmo < 0 that this means
that there is no need to report timeouts quickly.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: James Bottomley <JBottomley@Odin.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Bart Van Assche authored and Doug Ledford committed May 18, 2015
1 parent a44074f commit e68ca75
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/scsi/scsi_transport_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ static inline struct Scsi_Host *rport_to_shost(struct srp_rport *r)
return dev_to_shost(r->dev.parent);
}

static inline struct srp_rport *shost_to_rport(struct Scsi_Host *shost)
{
return transport_class_to_srp_rport(&shost->shost_gendev);
}

/**
* srp_tmo_valid() - check timeout combination validity
* @reconnect_delay: Reconnect delay in seconds.
Expand Down Expand Up @@ -628,9 +633,11 @@ static enum blk_eh_timer_return srp_timed_out(struct scsi_cmnd *scmd)
struct scsi_device *sdev = scmd->device;
struct Scsi_Host *shost = sdev->host;
struct srp_internal *i = to_srp_internal(shost->transportt);
struct srp_rport *rport = shost_to_rport(shost);

pr_debug("timeout for sdev %s\n", dev_name(&sdev->sdev_gendev));
return i->f->reset_timer_if_blocked && scsi_device_blocked(sdev) ?
return rport->fast_io_fail_tmo < 0 && rport->dev_loss_tmo < 0 &&
i->f->reset_timer_if_blocked && scsi_device_blocked(sdev) ?
BLK_EH_RESET_TIMER : BLK_EH_NOT_HANDLED;
}

Expand Down

0 comments on commit e68ca75

Please sign in to comment.