diff options
author | Keith Busch <keith.busch@intel.com> | 2014-12-19 17:54:13 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-12-20 10:33:53 -0700 |
commit | c76541a932113faa5b3be65a3f0a3d4ebbc86aeb (patch) | |
tree | 7643e5fd0f52568f940401382b714c0314e2d1f4 /block/blk-mq.c | |
parent | ecb5ec044ab99be1f35e93962fa43e4bb3120d9e (diff) |
blk-mq: Exit queue on alloc failure
Fixes usage counter when a request could not be allocated.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index da1ab5641227..bfe0f1f9cfa0 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -258,8 +258,10 @@ struct request *blk_mq_alloc_request(struct request_queue *q, int rw, gfp_t gfp, ctx = alloc_data.ctx; } blk_mq_put_ctx(ctx); - if (!rq) + if (!rq) { + blk_mq_queue_exit(q); return ERR_PTR(-EWOULDBLOCK); + } return rq; } EXPORT_SYMBOL(blk_mq_alloc_request); |