diff options
author | Brian King <brking@us.ibm.com> | 2006-02-24 18:10:04 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-02-27 22:38:39 -0500 |
commit | 8884efab1516613215816d48132dd724508970bf (patch) | |
tree | 613b80a6adea59defeed3a1fa9fdc6dde7313a28 /drivers/scsi/scsi_error.c | |
parent | 147aab6aa22ce7775be944f8fb9932aa000dda61 (diff) |
[SCSI] scsi: scsi command retries off by one fix
Fix up an off by one error in calculating retries for scsi
commands. This bug was discovered when an SG_IO request
was sent to scsi core with retries = 0, causing the overall
timeout check to go off in scsi_softirq_done.
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 5cc97b721661..ff82ccfbb106 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -1308,7 +1308,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) | |||
1308 | * the request was not marked fast fail. Note that above, | 1308 | * the request was not marked fast fail. Note that above, |
1309 | * even if the request is marked fast fail, we still requeue | 1309 | * even if the request is marked fast fail, we still requeue |
1310 | * for queue congestion conditions (QUEUE_FULL or BUSY) */ | 1310 | * for queue congestion conditions (QUEUE_FULL or BUSY) */ |
1311 | if ((++scmd->retries) < scmd->allowed | 1311 | if ((++scmd->retries) <= scmd->allowed |
1312 | && !blk_noretry_request(scmd->request)) { | 1312 | && !blk_noretry_request(scmd->request)) { |
1313 | return NEEDS_RETRY; | 1313 | return NEEDS_RETRY; |
1314 | } else { | 1314 | } else { |
@@ -1433,7 +1433,7 @@ static void scsi_eh_flush_done_q(struct list_head *done_q) | |||
1433 | list_del_init(&scmd->eh_entry); | 1433 | list_del_init(&scmd->eh_entry); |
1434 | if (scsi_device_online(scmd->device) && | 1434 | if (scsi_device_online(scmd->device) && |
1435 | !blk_noretry_request(scmd->request) && | 1435 | !blk_noretry_request(scmd->request) && |
1436 | (++scmd->retries < scmd->allowed)) { | 1436 | (++scmd->retries <= scmd->allowed)) { |
1437 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush" | 1437 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush" |
1438 | " retry cmd: %p\n", | 1438 | " retry cmd: %p\n", |
1439 | current->comm, | 1439 | current->comm, |