ide-tape,floppy: fix failed command completion after request sense
authorTejun Heo <tj@kernel.org>
Sat, 18 Apr 2009 23:46:02 +0000 (08:46 +0900)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 28 Apr 2009 05:37:31 +0000 (07:37 +0200)
commit08f370f0a2fb223bf48d0bfa2a173be0393c19dc
tree1e9af2e0941f1c8bd590f32c342676763f451046
parent765139ef5f1a4b1d5cb1f1a7a12de7ee61f6500f
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>
drivers/ide/ide-floppy.c
drivers/ide/ide-tape.c