aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-04-18 19:46:02 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 01:37:31 -0400
commit08f370f0a2fb223bf48d0bfa2a173be0393c19dc (patch)
tree1e9af2e0941f1c8bd590f32c342676763f451046 /drivers/ide/ide-tape.c
parent765139ef5f1a4b1d5cb1f1a7a12de7ee61f6500f (diff)
ide-tape,floppy: fix failed command completion after request sense
Impact: fix infinite retry loop After a command failed, ide-tape and floppy inserts REQUEST_SENSE in front of the failed command and according to the result, sets pc->retries, flags and errors. After REQUEST_SENSE is complete, the failed command is again at the front of the queue and if the verdict was to terminate the request, the issue functions tries to complete it directly by calling drive->pc_callback() and returning ide_stopped. However, drive->pc_callback() doesn't complete a request. It only prepares for completion of the request. As a result, this creates an infinite loop where the failed request is retried perpetually. Fix it by actually ending the request by calling ide_complete_rq(). Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 9b762a2d5d95..2b9a13671c5f 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -643,6 +643,7 @@ static ide_startstop_t ide_tape_issue_pc(ide_drive_t *drive,
643 } 643 }
644 drive->failed_pc = NULL; 644 drive->failed_pc = NULL;
645 drive->pc_callback(drive, 0); 645 drive->pc_callback(drive, 0);
646 ide_complete_rq(drive, -EIO, blk_rq_bytes(drive->hwif->rq));
646 return ide_stopped; 647 return ide_stopped;
647 } 648 }
648 debug_log(DBG_SENSE, "Retry #%d, cmd = %02X\n", pc->retries, pc->c[0]); 649 debug_log(DBG_SENSE, "Retry #%d, cmd = %02X\n", pc->retries, pc->c[0]);