[PATCH V4 8/9] nvmet-loop: do not alloc admin tag set during reset
Hannes Reinecke
hare at suse.de
Mon May 11 02:55:58 PDT 2026
On 5/8/26 15:33, Maurizio Lombardi wrote:
> Currently, resetting a loopback controller unconditionally invokes
> nvme_alloc_admin_tag_set() inside nvme_loop_configure_admin_queue().
> Doing so drops the old queue and allocates a new one. Consequently,
> this reverts the admin queue's timeout (q->rq_timeout) back to the
> module default (NVME_ADMIN_TIMEOUT), completely wiping out any custom
> timeout values the user may have configured via sysfs and potentially
> racing against the sysfs nvme_admin_timeout_store() function
> that may dereference the admin_q pointer during the RESETTING state.
>
> Decouple the admin tag set lifecycle from the admin queue
> configuration and destruction paths, which are executed during resets;
> Specifically:
>
> * Move nvme_alloc_admin_tag_set() into nvme_loop_create_ctrl() so it
> is only allocated once during the initial controller creation.
>
> * Defer the destruction of the admin tag set to
> nvme_loop_delete_ctrl_host() and the terminal error-handling
> paths of nvme_loop_reset_ctrl_work() and
> nvme_loop_create_ctrl().
>
> Signed-off-by: Maurizio Lombardi <mlombard at redhat.com>
> ---
> drivers/nvme/target/loop.c | 31 ++++++++++++++++---------------
> 1 file changed, 16 insertions(+), 15 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