]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
cciss: fix residual count for block pc requests
authorJens Axboe <jens.axboe@oracle.com>
Fri, 27 Mar 2009 09:43:52 +0000 (10:43 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 7 Apr 2009 06:12:38 +0000 (08:12 +0200)
We must complete the full request, so store the request count and then set
the ->data_len to the residual count from the hardware.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/cciss.c

index 5d0e135824f9c3e96bb76de0c5f88b259d50a241..f15b177085370b6bab16e4f4d67cf1f2df65f14e 100644 (file)
@@ -1287,6 +1287,7 @@ static void cciss_softirq_done(struct request *rq)
 {
        CommandList_struct *cmd = rq->completion_data;
        ctlr_info_t *h = hba[cmd->ctlr];
+       unsigned int nr_bytes;
        unsigned long flags;
        u64bit temp64;
        int i, ddir;
@@ -1308,7 +1309,14 @@ static void cciss_softirq_done(struct request *rq)
        printk("Done with %p\n", rq);
 #endif                         /* CCISS_DEBUG */
 
-       if (blk_end_request(rq, (rq->errors == 0) ? 0 : -EIO, blk_rq_bytes(rq)))
+       /*
+        * Store the full size and set the residual count for pc requests
+        */
+       nr_bytes = blk_rq_bytes(rq);
+       if (blk_pc_request(rq))
+               rq->data_len = cmd->err_info->ResidualCnt;
+
+       if (blk_end_request(rq, (rq->errors == 0) ? 0 : -EIO, nr_bytes))
                BUG();
 
        spin_lock_irqsave(&h->lock, flags);