X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2Fscsi_error.c;h=ff82ccfbb106b528539e112168a1aba8d250294c;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=1c75646f9689da6a9d2160744e7e402f8ac27b50;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 1c75646f9..ff82ccfbb 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -164,12 +163,16 @@ void scsi_times_out(struct scsi_cmnd *scmd) { scsi_log_completion(scmd, TIMEOUT_ERROR); - if (scmd->device->host->transportt->eh_timed_out) - switch (scmd->device->host->transportt->eh_timed_out(scmd)) { + if (scmd->device->host->hostt->eh_timed_out) + switch (scmd->device->host->hostt->eh_timed_out(scmd)) { case EH_HANDLED: __scsi_done(scmd); return; case EH_RESET_TIMER: + /* This allows a single retry even of a command + * with allowed == 0 */ + if (scmd->retries++ > scmd->allowed) + break; scsi_add_timer(scmd, scmd->timeout_per_command, scsi_times_out); return; @@ -581,7 +584,8 @@ static int scsi_request_sense(struct scsi_cmnd *scmd) * keep a list of pending commands for final completion, and once we * are ready to leave error handling we handle completion for real. **/ -void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, struct list_head *done_q) +static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, + struct list_head *done_q) { scmd->device->host->host_failed--; scmd->eh_eflags = 0; @@ -593,7 +597,6 @@ void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, struct list_head *done_q) scsi_setup_cmd_retry(scmd); list_move_tail(&scmd->eh_entry, done_q); } -EXPORT_SYMBOL(scsi_eh_finish_cmd); /** * scsi_eh_get_sense - Get device sense data. @@ -1422,7 +1425,7 @@ static void scsi_eh_ready_devs(struct Scsi_Host *shost, * @done_q: list_head of processed commands. * **/ -void scsi_eh_flush_done_q(struct list_head *done_q) +static void scsi_eh_flush_done_q(struct list_head *done_q) { struct scsi_cmnd *scmd, *next; @@ -1451,7 +1454,6 @@ void scsi_eh_flush_done_q(struct list_head *done_q) } } } -EXPORT_SYMBOL(scsi_eh_flush_done_q); /** * scsi_unjam_host - Attempt to fix a host which has a cmd that failed. @@ -1537,8 +1539,8 @@ int scsi_error_handler(void *data) * what we need to do to get it up and online again (if we can). * If we fail, we end up taking the thing offline. */ - if (shost->transportt->eh_strategy_handler) - shost->transportt->eh_strategy_handler(shost); + if (shost->hostt->eh_strategy_handler) + shost->hostt->eh_strategy_handler(shost); else scsi_unjam_host(shost);