[PATCH 2/2] nvme: re-read ANA log page after ns scan completes
Keith Busch
kbusch at kernel.org
Thu Apr 3 07:55:37 PDT 2025
On Thu, Apr 03, 2025 at 09:19:30AM +0200, Hannes Reinecke wrote:
> When scanning for new namespaces we might have missed an ANA AEN,
> so we should always re-read the ANA log page after scanning to ensure
> we don't miss updates there.
Worst case we might check a log page that hasn't changed. Rescans should
be rare, so I guess it's fine. But I'm not sure why scanning might cause
an ANA AEN to be missed. ?
> Signed-off-by: Hannes Reinecke <hare at kernel.org>
> ---
> drivers/nvme/host/core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 70f9c2d2b113..6197de34c3c8 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4296,6 +4296,11 @@ static void nvme_scan_work(struct work_struct *work)
> /* Requeue if we have missed AENs */
> if (test_bit(NVME_AER_NOTICE_NS_CHANGED, &ctrl->events))
> nvme_queue_scan(ctrl);
> +#if CONFIG_NVME_MULTIPATH
> + else
> + /* Re-read the ANA log page to not miss updates */
> + queue_work(nvme_wq, &ctrl->ana_work);
> +#endif
More information about the Linux-nvme
mailing list