@@ -1711,7 +1711,6 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
* by blk_insert_cloned_request() via blk_mq_request_direct_issue()
*/
bool dispatch_only = !cookie;
- bool need_insert = false;
/* RCU or SRCU read lock is needed before checking quiesced flag */
if (blk_mq_hctx_stopped(hctx) || blk_queue_quiesced(q)) {
@@ -1722,15 +1721,9 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
if (q->elevator && !dispatch_only)
goto insert;
- if (!blk_mq_get_driver_tag(rq, NULL, false))
- need_insert = true;
-
- if (!need_insert && !blk_mq_get_dispatch_budget(hctx)) {
+ if (!blk_mq_get_driver_tag(rq, NULL, false) ||
+ !blk_mq_get_dispatch_budget(hctx)) {
blk_mq_put_driver_tag(rq);
- need_insert = true;
- }
-
- if (need_insert) {
if (dispatch_only)
return BLK_STS_RESOURCE;
goto insert;