summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2014-12-19 17:54:13 -0700
committerJens Axboe <axboe@fb.com>2014-12-20 10:33:53 -0700
commitc76541a932113faa5b3be65a3f0a3d4ebbc86aeb (patch)
tree7643e5fd0f52568f940401382b714c0314e2d1f4
parentecb5ec044ab99be1f35e93962fa43e4bb3120d9e (diff)
downloadlinux-stable-c76541a932113faa5b3be65a3f0a3d4ebbc86aeb.tar.gz
linux-stable-c76541a932113faa5b3be65a3f0a3d4ebbc86aeb.tar.bz2
linux-stable-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>
-rw-r--r--block/blk-mq.c4
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);