From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F272E4963DD; Sat, 28 Feb 2026 17:34:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300072; cv=none; b=CD0BVv/hrzQordmEJKRctV+dcVULotd2QJ/+ntFm10PPjhWmg9GUMU8/0VXzkNOs+3QdCqyvq0t+5qtafYHDVyPte8v6hMcqDXjHRFgnSJJrz07q1AI8zIrr675l8p6iewY7hWeu/BIbXOakkq/PXqr5po3Mrq8wKy2k3NgVPMQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300072; c=relaxed/simple; bh=NJLBrRX2j4NQXdAxOknzdGN5sq8YYJbadoVPGouiUgc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bq6CCxXRJnKGyzDvVapqoE24o1V0GvZJjj4wsViAkP+YAJrC+do9f4Z6DtrhCkjz39Mg5EB0fK6gR4ZoVEEI94AmlBSCJs7TKwxWRgRyu305Iqy6RwpWqUo/TCm0Jy/rA7bmr7buyE9mY+M6wDrwxYzAOjIQNCsti8P/EcDh/O0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PKoJgdTS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PKoJgdTS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 080A5C116D0; Sat, 28 Feb 2026 17:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772300071; bh=NJLBrRX2j4NQXdAxOknzdGN5sq8YYJbadoVPGouiUgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PKoJgdTSiWfkQYKb3buqqp2ZlGfojiTw20RQkssXYJqiSD3OpDf1QuZjEK0A1wtbF Z4YDi/9GvVcRvaFffR/wvZdHu/Cf/fJ+r5ryeRUYuJijkaRNVASF1lpAdqCz+m0R5a s9mcFdCK7wh9kgk81VlzfuvQfYz5RlyNTjcN0TDh6SRsFWxQL81fnNkaLMsMjJ+8nY AqUz3PiikC2+oNsJcy+/HIi5mFzRQBjOm6b4L846iUJxtTTQbh9SNaSzWGDbj+fPLn LuNAszbSnbVQQhOv2eIJWJQqzHHsTbWqBiY9wjBTqzIOBqfFco/bqLvGX+aRWO5+wW L5Zl0i7af+v6g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yu Kuai , Nilay Shroff , Ming Lei , Hannes Reinecke , Jens Axboe , Sasha Levin Subject: [PATCH 6.19 086/844] blk-mq-debugfs: add missing debugfs_mutex in blk_mq_debugfs_register_hctxs() Date: Sat, 28 Feb 2026 12:19:59 -0500 Message-ID: <20260228173244.1509663-87-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228173244.1509663-1-sashal@kernel.org> References: <20260228173244.1509663-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Yu Kuai [ Upstream commit 9d20fd6ce1ba9733cd5ac96fcab32faa9fc404dd ] 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 Reviewed-by: Nilay Shroff Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-mq-debugfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 4896525b1c054..553d93b88e194 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -686,8 +686,10 @@ void blk_mq_debugfs_register_hctxs(struct request_queue *q) struct blk_mq_hw_ctx *hctx; unsigned long i; + mutex_lock(&q->debugfs_mutex); queue_for_each_hw_ctx(q, hctx, i) blk_mq_debugfs_register_hctx(q, hctx); + mutex_unlock(&q->debugfs_mutex); } void blk_mq_debugfs_unregister_hctxs(struct request_queue *q) -- 2.51.0