[PATCH] nvme-tcp: fix NULL queue->ctrl dereference on reconnect

Keith Busch kbusch at kernel.org
Tue Oct 27 18:48:05 PDT 2026


On Tue, Oct 27, 2026 at 09:26:54PM -0300, Christian Aurich Zanettini Martins wrote:
> +static void nvme_tcp_init_queue(struct nvme_tcp_ctrl *ctrl, int qid)
> +{
> +	struct nvme_tcp_queue *queue = &ctrl->queues[qid];
> +
> +	queue->ctrl = ctrl;
> +	mutex_init(&queue->pf_cache_lock);
> +	queue->hdr_digest = ctrl->ctrl.opts->hdr_digest;
> +	queue->data_digest = ctrl->ctrl.opts->data_digest;

It's a good start, but if we're introducing an init helper, let's take
it all the way! The queue_lock at least is something Guixin has in a
conflicting patch here:

https://lore.kernel.org/linux-nvme/20261027123950.3122316-1-kanie@linux.alibaba.com/

Other fields including io_work and send_mutex look safe to move here too.



More information about the Linux-nvme mailing list