From: Tejun Heo <tj@kernel.org>
To: petkovbb@googlemail.com, bzolnier@gmail.com, axboe@kernel.dk,
linux-ide@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 01/10] ide-tape,floppy: fix failed command completion after request sense
Date: Sun, 19 Apr 2009 08:58:33 +0900 [thread overview]
Message-ID: <1240099122-18381-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1240099122-18381-1-git-send-email-tj@kernel.org>
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 | 1 +
drivers/ide/ide-tape.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index d3302cc..d20704a 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -141,6 +141,7 @@ static ide_startstop_t ide_floppy_issue_pc(ide_drive_t *drive,
drive->failed_pc = NULL;
drive->pc_callback(drive, 0);
+ ide_complete_rq(drive, -EIO, blk_rq_bytes(drive->hwif->rq));
return ide_stopped;
}
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 9b762a2..2b9a136 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,
}
drive->failed_pc = NULL;
drive->pc_callback(drive, 0);
+ ide_complete_rq(drive, -EIO, blk_rq_bytes(drive->hwif->rq));
return ide_stopped;
}
debug_log(DBG_SENSE, "Retry #%d, cmd = %02X\n", pc->retries, pc->c[0]);
--
1.6.0.2
next prev parent reply other threads:[~2009-04-18 23:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-18 23:58 [GIT PATCH pata-2.6] ide: clean up ide-tape, take#2 Tejun Heo
2009-04-18 23:58 ` Tejun Heo [this message]
2009-04-18 23:58 ` [PATCH 02/10] ide-atapi,tape,floppy: allow ->pc_callback() to change rq->data_len Tejun Heo
2009-04-18 23:58 ` [PATCH 03/10] ide-tape: use single continuous buffer Tejun Heo
2009-04-18 23:58 ` [PATCH 04/10] ide-tape: use standard data transfer mechanism Tejun Heo
2009-04-18 23:58 ` [PATCH 05/10] ide-tape: kill idetape_bh Tejun Heo
2009-04-18 23:58 ` [PATCH 06/10] ide-tape: unify r/w init paths Tejun Heo
2009-04-20 13:20 ` Sergei Shtylyov
2009-04-18 23:58 ` [PATCH 07/10] ide-tape: use byte size instead of sectors on rw issue functions Tejun Heo
2009-04-20 13:39 ` Sergei Shtylyov
2009-04-18 23:58 ` [PATCH 08/10] ide-tape: simplify read/write functions Tejun Heo
2009-04-18 23:58 ` [PATCH 09/10] ide-atapi: kill unused fields and callbacks Tejun Heo
2009-04-18 23:58 ` [PATCH 10/10] ide: drop rq->data handling from ide_map_sg() Tejun Heo
2009-04-20 11:57 ` [GIT PATCH pata-2.6] ide: clean up ide-tape, take#2 Bartlomiej Zolnierkiewicz
2009-04-21 3:23 ` [PATCH #ide-phase2] ide-dma: don't reset request fields on dma_timeout_retry() Tejun Heo
2009-04-21 11:53 ` Bartlomiej Zolnierkiewicz
2009-04-21 16:34 ` Tejun Heo
2009-04-21 5:09 ` [GIT PATCH pata-2.6] ide: clean up ide-tape, take#2 Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1240099122-18381-2-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=petkovbb@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).