On Mon, 2005-01-31 at 09:36 -0800, Patrick Mansfield wrote: > On Mon, Jan 31, 2005 at 11:56:02AM -0500, [EMAIL PROTECTED] wrote: > > > On Sat, 2005-01-29 at 11:34 -0800, Patrick Mansfield wrote: > > > > > > > > > Why not just set scmd->retries to zero in scsi_requeue_command()? > > > > > > > > > > This is exactly what I was thinking would be a fairly straight-forward > > > approach at solving the problem... > > > > This is ultimately a hack, and raises the potential for the retries value > > to perpetually be rezero'd. The better solution is the use the block > > primitives available to avoid the i/o being issued at all if the transport > > can't handle it. > > No, it does not change the potential to retry forever, someone still has > to requeue the IO again outside of the NEEDS_RETRY/scsi_retry_command case > for that to happen. > > We only check retries in scsi_decide_disposition (well not counting error > handling), and if we hit the limit, return SUCCESS. The change is that we > reset retries to zero if the command is *not* retried via > NEEDS_RETRY/scsi_retry_command. > > It would be even clearer to zero retries in scsi_decide_disposition. > > For NOT_READY, we would be better off always using the > scsi_requeue_command path ever: get rid of the check in scsi_check_sense, > as it will be requeued via scsi_io_completion code. This would have to > happen even if delaying retries to NOT_READY devices. >
Here's a small patch against the latest scsi-rc-fixes tree I've been running with which allows my basic cable-pull test to complete without incident. Please consider for inclusion. As per Patrick M's suggestions: * reset a command's retries count in scsi_decide_disposition() in case of additional requiring by upper layer. * remove redundant check for NOT_READY (ASC: 0x04 ASCQ: 0x01) in scsi_check_sense(). Signed-off-by: Andrew Vasquez <[EMAIL PROTECTED]> scsi_error.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) ===== drivers/scsi/scsi_error.c 1.86 vs edited ===== --- 1.86/drivers/scsi/scsi_error.c 2005-01-17 22:54:45 -08:00 +++ edited/drivers/scsi/scsi_error.c 2005-01-31 23:01:54 -08:00 @@ -327,12 +327,6 @@ static int scsi_check_sense(struct scsi_ return NEEDS_RETRY; } /* - * if the device is in the process of becoming ready, we - * should retry. - */ - if ((sshdr.asc == 0x04) && (sshdr.ascq == 0x01)) - return NEEDS_RETRY; - /* * if the device is not started, we need to wake * the error handler to start the motor */ @@ -1405,7 +1399,10 @@ int scsi_decide_disposition(struct scsi_ } else { /* * no more retries - report this one back to upper level. + * clear retries in case the command is requeued by + * upper level. */ + scmd->retries = 0; return SUCCESS; } } - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html