Re: [PATCH] nvmet-auth: Synchronize timeout work during SQ teardown

From: Keith Busch

Date: Wed Sep 02 2026 - 18:31:35 EST


On Sun, Aug 30, 2026 at 10:11:05PM +0900, Kazuki Hanai wrote:
> nvmet_auth_sq_free() cancels auth_expired_work with
> cancel_delayed_work(). If the work has already started, cancellation does
> not wait for the callback. Transport teardown can consequently free or
> reuse the queue containing struct nvmet_sq while
> nvmet_auth_expired_work() still accesses that SQ.
>
> Add a teardown-specific helper that synchronously drains the delayed work
> before freeing authentication state, and use it from nvmet_sq_destroy().
> Keep the non-synchronous helper for in-band authentication state cleanup,
> where the SQ owner remains alive.

Thanks, applied to nvme-7.3.