Re: [PATCH 1/5] nvme-tcp: initialize pf_cache_lock when allocating the controller
From: Hannes Reinecke
Date: Wed Oct 21 2026 - 07:08:47 EST
On 10/14/26 9:46 AM, Daniel Wagner wrote:
From: Daniel Wagner <wagi@xxxxxxxxxx>Reviewed-by: Hannes Reinecke <hare@xxxxxxxxxx>
Since commit 61b0ed3be81b ("nvme-tcp: parallelize I/O queue allocation
and startup") the I/O tag set is allocated before the I/O queues.
blk_mq_alloc_tag_set calls nvme_tcp_init_request for every request,
which takes pf_cache_lock of the request's queue, but nvme_tcp_alloc_queue
initializes that mutex only later. With CONFIG_DEBUG_MUTEXES the first
connect triggers DEBUG_LOCKS_WARN_ON(lock->magic != lock) in
__mutex_lock and lock debugging is disabled.
Initialize pf_cache_lock for all queues when allocating the controller
and keep it for the lifetime of the controller.
Fixes: 61b0ed3be81b ("nvme-tcp: parallelize I/O queue allocation and startup")
Signed-off-by: Daniel Wagner <wagi@xxxxxxxxxx>
---
drivers/nvme/host/tcp.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich