[PATCH v3] nvme-tcp: Validate the queue state under the queue lock in the address attribute

Keith Busch kbusch at kernel.org
Tue Oct 27 16:20:45 PDT 2026


On Tue, Oct 27, 2026 at 08:39:50PM +0800, Guixin Liu wrote:
> @@ -3035,6 +3048,14 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev,
>  		goto out_free_ctrl;
>  	}
>  
> +	/*
> +	 * The queue locks are owned by the controller, not the queues:
> +	 * they outlive the per-queue connect/disconnect cycles so that
> +	 * sysfs readers can never race their destruction.
> +	 */
> +	for (i = 0; i < ctrl->ctrl.queue_count; i++)
> +		mutex_init(&ctrl->queues[i].queue_lock);
> +

Could you rebase to the latest nvme-7.4 branch? There is already a loop
happening here to initialize other fields in the queue.



More information about the Linux-nvme mailing list