Skip to content

Commit 0994c64

Browse files
John Garryaxboe
authored andcommitted
blk-mq: Fix blk_mq_tagset_busy_iter() for shared tags
Since it is now possible for a tagset to share a single set of tags, the iter function should not re-iter the tags for the count of #hw queues in that case. Rather it should just iter once. Fixes: e155b0c ("blk-mq: Use shared tags for shared sbitmap support") Reported-by: Kashyap Desai <[email protected]> Signed-off-by: John Garry <[email protected]> Reviewed-by: Ming Lei <[email protected]> Tested-by: Kashyap Desai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 008f75a commit 0994c64

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

block/blk-mq-tag.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,12 @@ void blk_mq_all_tag_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn,
399399
void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
400400
busy_tag_iter_fn *fn, void *priv)
401401
{
402-
int i;
402+
unsigned int flags = tagset->flags;
403+
int i, nr_tags;
404+
405+
nr_tags = blk_mq_is_shared_tags(flags) ? 1 : tagset->nr_hw_queues;
403406

404-
for (i = 0; i < tagset->nr_hw_queues; i++) {
407+
for (i = 0; i < nr_tags; i++) {
405408
if (tagset->tags && tagset->tags[i])
406409
__blk_mq_all_tag_iter(tagset->tags[i], fn, priv,
407410
BT_TAG_ITER_STARTED);

0 commit comments

Comments
 (0)