summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2008-01-18 20:02:15 +0300
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-30 22:03:41 +0300
commitb8de16318410f6f8611a879678a531237e4aadc9 (patch)
tree3451b3bb3ccd95d17ebe246d455a90a5d4fb172b /drivers/scsi/scsi_lib.c
parent6f9a35e2dafa0f855ab051c11bdbf739745ff6f5 (diff)
downloadlinux-b8de16318410f6f8611a879678a531237e4aadc9.tar.xz
[SCSI] bidirectional: fix up for the new blk_end_request code
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 681ed1b830f5..4560713ecb14 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -812,8 +812,16 @@ EXPORT_SYMBOL(scsi_release_buffers);
*/
void scsi_end_bidi_request(struct scsi_cmnd *cmd)
{
- blk_end_bidi_request(cmd->request, 0, scsi_out(cmd)->resid,
- scsi_in(cmd)->resid);
+ struct request *req = cmd->request;
+ unsigned int dlen = req->data_len;
+ unsigned int next_dlen = req->next_rq->data_len;
+
+ req->data_len = scsi_out(cmd)->resid;
+ req->next_rq->data_len = scsi_in(cmd)->resid;
+
+ /* The req and req->next_rq have not been completed */
+ BUG_ON(blk_end_bidi_request(req, 0, dlen, next_dlen));
+
scsi_release_buffers(cmd);
/*