Skip to content
/ linux Public

Commit 648aa7c

Browse files
hailan94Sasha Levin
authored andcommitted
blk-mq-debugfs: add missing debugfs_mutex in blk_mq_debugfs_register_hctxs()
[ Upstream commit 9d20fd6 ] In blk_mq_update_nr_hw_queues(), debugfs_mutex is not held while creating debugfs entries for hctxs. Hence add debugfs_mutex there, it's safe because queue is not frozen. Signed-off-by: Yu Kuai <yukuai@fnnas.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9150176 commit 648aa7c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

block/blk-mq-debugfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,10 @@ void blk_mq_debugfs_register_hctxs(struct request_queue *q)
730730
struct blk_mq_hw_ctx *hctx;
731731
unsigned long i;
732732

733+
mutex_lock(&q->debugfs_mutex);
733734
queue_for_each_hw_ctx(q, hctx, i)
734735
blk_mq_debugfs_register_hctx(q, hctx);
736+
mutex_unlock(&q->debugfs_mutex);
735737
}
736738

737739
void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)

0 commit comments

Comments
 (0)