Re: [PATCH] nvme-tcp: fix NULL queue->ctrl dereference on reconnect
From: Keith Busch
Date: Tue Oct 27 2026 - 21:48:28 EST
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@xxxxxxxxxxxxxxxxx/
Other fields including io_work and send_mutex look safe to move here too.