On Thu, Oct 23 2008, Miquel van Smoorenburg wrote:
You didn't happen to log a backtrace from that, did you? That's a weird
nr_bytes, it's 0xff0000.
I'm assuming this then fixes it, just wondering what the heck is going
on here.
diff --git a/block/blk-core.c b/block/blk-core.c
index 33c8d4b..a372618 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1712,11 +1710,12 @@ static int __end_that_request_first(struct request *req, int error,
if (blk_fs_request(req) && req->rq_disk) {
const int rw = rq_data_dir(req);
struct hd_struct *part;
- int cpu;
+ int cpu, sectors;
+ sectors = min_t(int, nr_bytes >> 9, req->hard_nr_sectors);
cpu = part_stat_lock();
part = disk_map_sector_rcu(req->rq_disk, req->sector);
- part_stat_add(cpu, part, sectors[rw], nr_bytes >> 9);
+ part_stat_add(cpu, part, sectors[rw], sectors);
part_stat_unlock();
}
--
Jens Axboe
--