[PATCH 1/5] nvme-tcp: initialize pf_cache_lock when allocating the controller
Hannes Reinecke
hare at suse.de
Wed Oct 21 04:05:26 PDT 2026
On 10/14/26 9:46 AM, Daniel Wagner wrote:
> From: Daniel Wagner <wagi at kernel.org>
>
> 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 at kernel.org>
> ---
> drivers/nvme/host/tcp.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare at kernel.org>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +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
More information about the Linux-nvme
mailing list