summaryrefslogtreecommitdiffstats
path: root/block/blk-mq-sched.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2017-01-26 14:52:20 -0700
committerJens Axboe <axboe@fb.com>2017-01-26 14:52:20 -0700
commitb48fda0976a802e0fe4fc0bedefb7cf380ec6426 (patch)
tree658372c505c9b9ef2c3956e7450c928a107b6405 /block/blk-mq-sched.c
parent5a797e00dc93593c9915841779881b15d9856237 (diff)
downloadlinux-b48fda0976a802e0fe4fc0bedefb7cf380ec6426.tar.bz2
blk-mq-sched: check for successful allocation before assigning tag
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>
Diffstat (limited to 'block/blk-mq-sched.c')
-rw-r--r--block/blk-mq-sched.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index 56b92db944ae..4cee060a292d 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -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) {