Skip to content

Commit

Permalink
blk-mq: make driver tag failure path easier to follow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Omar Sandoval authored and Jens Axboe committed Apr 7, 2017
1 parent ee056f9 commit 807b104
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 807b104

Please sign in to comment.