Skip to content

Commit

Permalink
blk-mq-sched: check for successful allocation before assigning tag
Browse files Browse the repository at this point in the history
We don't trigger this from the normal IO path, since we always use
blocking allocations from there. But Bart saw it testing multipath
dm, since that is a heavy user of atomic request allocations in
the map and clone path.

Reported-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
axboe committed Jan 26, 2017
1 parent 5a797e0 commit b48fda0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/blk-mq-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ struct request *blk_mq_sched_get_request(struct request_queue *q,
rq = __blk_mq_alloc_request(data, op);
} else {
rq = __blk_mq_alloc_request(data, op);
data->hctx->tags->rqs[rq->tag] = rq;
if (rq)
data->hctx->tags->rqs[rq->tag] = rq;
}

if (rq) {
Expand Down

0 comments on commit b48fda0

Please sign in to comment.