diff options
author | Keith Busch <keith.busch@intel.com> | 2014-12-20 01:54:13 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-12-20 18:33:53 +0100 |
commit | c76541a932113faa5b3be65a3f0a3d4ebbc86aeb (patch) | |
tree | 7643e5fd0f52568f940401382b714c0314e2d1f4 /block | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir... (diff) | |
download | linux-c76541a932113faa5b3be65a3f0a3d4ebbc86aeb.tar.xz linux-c76541a932113faa5b3be65a3f0a3d4ebbc86aeb.zip |
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')
-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); |