[PATCH V4 8/9] nvmet-loop: do not alloc admin tag set during reset
Daniel Wagner
dwagner at suse.de
Fri May 8 10:09:06 PDT 2026
On Fri, May 08, 2026 at 03:33:34PM +0200, 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>
Reviewed-by: Daniel Wagner <dwagner at suse.de>
More information about the Linux-nvme
mailing list