diff options
Diffstat (limited to 'block/blk-merge.c')
-rw-r--r-- | block/blk-merge.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c index 9b17da698d7c..eb2a3ca58303 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
@@ -387,14 +387,19 @@ static int attempt_merge(struct request_queue *q, struct request *req, | |||
387 | elv_merge_requests(q, req, next); | 387 | elv_merge_requests(q, req, next); |
388 | 388 | ||
389 | if (req->rq_disk) { | 389 | if (req->rq_disk) { |
390 | struct hd_struct *part = | 390 | struct hd_struct *part; |
391 | disk_map_sector(req->rq_disk, req->sector); | 391 | |
392 | rcu_read_lock(); | ||
393 | |||
394 | part = disk_map_sector_rcu(req->rq_disk, req->sector); | ||
392 | disk_round_stats(req->rq_disk); | 395 | disk_round_stats(req->rq_disk); |
393 | req->rq_disk->in_flight--; | 396 | req->rq_disk->in_flight--; |
394 | if (part) { | 397 | if (part) { |
395 | part_round_stats(part); | 398 | part_round_stats(part); |
396 | part->in_flight--; | 399 | part->in_flight--; |
397 | } | 400 | } |
401 | |||
402 | rcu_read_unlock(); | ||
398 | } | 403 | } |
399 | 404 | ||
400 | req->ioprio = ioprio_best(req->ioprio, next->ioprio); | 405 | req->ioprio = ioprio_best(req->ioprio, next->ioprio); |