[PATCH V4 7/9] nvme-core: align fabrics_q teardown with admin_q in nvme_free_ctrl
Hannes Reinecke
hare at suse.de
Mon May 11 02:53:35 PDT 2026
On 5/8/26 15:33, Maurizio Lombardi wrote:
> Currently, the final reference for the fabrics admin queue (fabrics_q)
> is dropped inside nvme_remove_admin_tag_set(). However, the primary
> admin queue (admin_q) defers dropping its final reference until
> nvme_free_ctrl().
>
> Move the blk_put_queue() call for fabrics_q from nvme_remove_admin_tag_set()
> to nvme_free_ctrl(). This aligns the lifecycle management of both admin
> queues, ensuring they are freed symmetrically when the controller is finally
> torn down.
>
> Reviewed-by: Daniel Wagner <dwagner at suse.de>
> Signed-off-by: Maurizio Lombardi <mlombard at redhat.com>
> ---
> drivers/nvme/host/core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 5d3200a66f8e..73575d087a07 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4932,10 +4932,8 @@ void nvme_remove_admin_tag_set(struct nvme_ctrl *ctrl)
> */
> nvme_stop_keep_alive(ctrl);
> blk_mq_destroy_queue(ctrl->admin_q);
> - if (ctrl->ops->flags & NVME_F_FABRICS) {
> + if (ctrl->ops->flags & NVME_F_FABRICS)
> blk_mq_destroy_queue(ctrl->fabrics_q);
> - blk_put_queue(ctrl->fabrics_q);
> - }
> blk_mq_free_tag_set(ctrl->admin_tagset);
> }
> EXPORT_SYMBOL_GPL(nvme_remove_admin_tag_set);
> @@ -5077,6 +5075,8 @@ static void nvme_free_ctrl(struct device *dev)
>
> if (ctrl->admin_q)
> blk_put_queue(ctrl->admin_q);
> + if (ctrl->fabrics_q)
> + blk_put_queue(ctrl->fabrics_q);
> if (!subsys || ctrl->instance != subsys->instance)
> ida_free(&nvme_instance_ida, ctrl->instance);
> nvme_free_cels(ctrl);
One wonders why we check for 'flags' in the first hunk, but for the
existence of 'fabrics_q' in the second hunk.
But anyway.
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