summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2017-04-05 12:01:35 -0700
committerJens Axboe <axboe@fb.com>2017-04-07 12:45:43 -0600
commit807b10417b23f1e1a35fccc7ede2c3886d39c303 (patch)
treee9dcc5f559201d3d3720615af4e558172dcbe30a /block
parentee056f98126170ca8b16b9a4a6e20aae7c5c184e (diff)
downloadlinux-stable-807b10417b23f1e1a35fccc7ede2c3886d39c303.tar.gz
linux-stable-807b10417b23f1e1a35fccc7ede2c3886d39c303.tar.bz2
linux-stable-807b10417b23f1e1a35fccc7ede2c3886d39c303.zip
blk-mq: make driver tag failure path easier to follow
Minor cleanup that makes it easier to figure out what's going on in the driver tag allocation failure path of blk_mq_dispatch_rq_list(). Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 724bcec0ca4f..b53ffcff2cec 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1003,17 +1003,16 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list)
* The initial allocation attempt failed, so we need to
* rerun the hardware queue when a tag is freed.
*/
- if (blk_mq_dispatch_wait_add(hctx)) {
- /*
- * It's possible that a tag was freed in the
- * window between the allocation failure and
- * adding the hardware queue to the wait queue.
- */
- if (!blk_mq_get_driver_tag(rq, &hctx, false))
- break;
- } else {
+ if (!blk_mq_dispatch_wait_add(hctx))
+ break;
+
+ /*
+ * It's possible that a tag was freed in the window
+ * between the allocation failure and adding the
+ * hardware queue to the wait queue.
+ */
+ if (!blk_mq_get_driver_tag(rq, &hctx, false))
break;
- }
}
list_del_init(&rq->queuelist);