[SCSI] bidirectional: fix up for the new blk_end_request code
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>
Fri, 18 Jan 2008 17:02:15 +0000 (12:02 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 30 Jan 2008 19:03:41 +0000 (13:03 -0600)
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>
drivers/scsi/scsi_lib.c

index 681ed1b830f5777ac88e81ee336b667fb8dfd2e6..4560713ecb14a17baee5b8a5df3896ee40faf273 100644 (file)
@@ -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);
 
        /*