diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-02-02 02:42:32 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-02-02 02:42:32 -0500 |
commit | fb8ec18c316d869271137c97320dbfd2def56569 (patch) | |
tree | 8cf6a84747e10f0cf78a1cb73b1ea69681da0d70 /block/blk-core.c | |
parent | 45c82b5a770be66845687a7d027c8b52946d59af (diff) |
block: fix oops in blk_queue_io_stat()
Some initial probe requests don't have disk->queue mapped yet, so we
can't rely on a non-NULL queue in blk_queue_io_stat(). Wrap it in
blk_do_io_stat().
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index ca69f3d94100..29bcfac6c688 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -69,7 +69,7 @@ static void drive_stat_acct(struct request *rq, int new_io) | |||
69 | int rw = rq_data_dir(rq); | 69 | int rw = rq_data_dir(rq); |
70 | int cpu; | 70 | int cpu; |
71 | 71 | ||
72 | if (!blk_fs_request(rq) || !disk || !blk_queue_io_stat(disk->queue)) | 72 | if (!blk_fs_request(rq) || !disk || !blk_do_io_stat(disk->queue)) |
73 | return; | 73 | return; |
74 | 74 | ||
75 | cpu = part_stat_lock(); | 75 | cpu = part_stat_lock(); |
@@ -1667,7 +1667,7 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes) | |||
1667 | { | 1667 | { |
1668 | struct gendisk *disk = req->rq_disk; | 1668 | struct gendisk *disk = req->rq_disk; |
1669 | 1669 | ||
1670 | if (!disk || !blk_queue_io_stat(disk->queue)) | 1670 | if (!disk || !blk_do_io_stat(disk->queue)) |
1671 | return; | 1671 | return; |
1672 | 1672 | ||
1673 | if (blk_fs_request(req)) { | 1673 | if (blk_fs_request(req)) { |
@@ -1686,7 +1686,7 @@ static void blk_account_io_done(struct request *req) | |||
1686 | { | 1686 | { |
1687 | struct gendisk *disk = req->rq_disk; | 1687 | struct gendisk *disk = req->rq_disk; |
1688 | 1688 | ||
1689 | if (!disk || !blk_queue_io_stat(disk->queue)) | 1689 | if (!disk || !blk_do_io_stat(disk->queue)) |
1690 | return; | 1690 | return; |
1691 | 1691 | ||
1692 | /* | 1692 | /* |