diff options
author | Tejun Heo <tj@kernel.org> | 2009-05-12 02:49:32 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-05-12 02:49:32 -0400 |
commit | e458824f9d32e9bf7700d1eb0d201749af48eee0 (patch) | |
tree | 6f6d755bb2617b1bf3f567d9cfc8c1752151aea7 /drivers/scsi | |
parent | 0b0a47f5c4a30b58432e20ae1706a27baea91a88 (diff) |
scsi: fix resid_len mis-conversion in scsi_end_request()
Commit c3a4d78c580de4edc9ef0f7c59812fb02ceb037f introduced
rq->data_len and converted residual count users to it. While
converting, it mistakenly converted scsi_end_request() to finish
requests with residual count when it wants to do is fully complete the
request. Fix it by using blk_end_request_all() instead.
This bug was spotted by Boaz Harrosh.
Signed-off-by: Tejun Heo <tj@kernel.org>
Spotted-by: Boaz Harrosh <bharrosh@panasas.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a54bec994386..e410d667910d 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -546,14 +546,9 @@ static struct scsi_cmnd *scsi_end_request(struct scsi_cmnd *cmd, int error, | |||
546 | * to queue the remainder of them. | 546 | * to queue the remainder of them. |
547 | */ | 547 | */ |
548 | if (blk_end_request(req, error, bytes)) { | 548 | if (blk_end_request(req, error, bytes)) { |
549 | int leftover = blk_rq_bytes(req); | ||
550 | |||
551 | if (blk_pc_request(req)) | ||
552 | leftover = req->resid_len; | ||
553 | |||
554 | /* kill remainder if no retrys */ | 549 | /* kill remainder if no retrys */ |
555 | if (error && scsi_noretry_cmd(cmd)) | 550 | if (error && scsi_noretry_cmd(cmd)) |
556 | blk_end_request(req, error, leftover); | 551 | blk_end_request_all(req, error); |
557 | else { | 552 | else { |
558 | if (requeue) { | 553 | if (requeue) { |
559 | /* | 554 | /* |