[PATCH V3 7/8] nvmet-loop: do not alloc admin tag set during reset

Maurizio Lombardi mlombard at arkamax.eu
Thu May 7 23:14:18 PDT 2026


On Thu May 7, 2026 at 6:23 PM CEST, Daniel Wagner wrote:
> Hi Maurizio,
>
> On 4/28/26 1:17 PM, Maurizio Lombardi wrote:
>> It would be something like this (just a compile tested draft,
>> I still need to properly test it, but it should give you an idea):
>> 
>> 
>> nvmet-loop: do not alloc admin tag set during reset
>> 
>> 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(), the terminal error-handling
>>    paths of nvme_loop_reset_ctrl_work() and
>>    nvme_loop_create_ctrl().
>
> This looks way better IMO. So yes please, add use this version.

Sure, I will post a new version very soon.

Maurizio



More information about the Linux-nvme mailing list