path: root/block/blk-mq-tag.h
diff options
authorJens Axboe <>2020-07-01 22:58:32 -0600
committerJens Axboe <>2020-07-01 22:58:32 -0600
commit4e2f62e566b5bddec00682f36a404e05a3b64b6a (patch)
tree25a8ce0db9465f8c3f9e3f78b0098b54ab9cc636 /block/blk-mq-tag.h
parentb53ac8b89157b5ff5d46c07eaa8b12e9d4e63b34 (diff)
Revert "blk-mq: put driver tag when this request is completed"
This reverts commits the following commits: 37f4a24c2469a10a4c16c641671bd766e276cf9f 723bf178f158abd1ce6069cb049581b3cb003aab 36a3df5a4574d5ddf59804fcd0c4e9654c514d9a The last one is the culprit, but we have to go a bit deeper to get this to revert cleanly. There's been a report that this breaks some MMC setups [1], and also causes an issue with swap [2]. Until this can be figured out, revert the offending commits. [1] [2] Reported-by: Marek Szyprowski <> Reported-by: Qian Cai <> Signed-off-by: Jens Axboe <>
Diffstat (limited to 'block/blk-mq-tag.h')
1 files changed, 12 insertions, 0 deletions
diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h
index b1acac518c4e..3945c7f5b944 100644
--- a/block/blk-mq-tag.h
+++ b/block/blk-mq-tag.h
@@ -101,6 +101,18 @@ static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx,
return atomic_read(&hctx->nr_active) < depth;
+ * This helper should only be used for flush request to share tag
+ * with the request cloned from, and both the two requests can't be
+ * in flight at the same time. The caller has to make sure the tag
+ * can't be freed.
+ */
+static inline void blk_mq_tag_set_rq(struct blk_mq_hw_ctx *hctx,
+ unsigned int tag, struct request *rq)
+ hctx->tags->rqs[tag] = rq;
static inline bool blk_mq_tag_is_reserved(struct blk_mq_tags *tags,
unsigned int tag)