From: Kiyoshi Ueda Date: Fri, 18 Jan 2008 17:02:15 +0000 (-0500) Subject: [SCSI] bidirectional: fix up for the new blk_end_request code X-Git-Tag: v2.6.25-rc1~1140^2~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8de16318410f6f8611a879678a531237e4aadc9;p=linux-2.6 [SCSI] bidirectional: fix up for the new blk_end_request code Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 681ed1b830..4560713ecb 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); /*