From: Hannes Reinecke Date: Thu, 3 Apr 2025 07:19:29 +0000 (+0200) Subject: nvme: requeue namespace scan on missed AENs X-Git-Tag: nvme-6.15-2025-04-10~11 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9546ad1a9bda7362492114f5866b95b0ac4a100e;p=nvme.git nvme: requeue namespace scan on missed AENs Scanning for namespaces can take some time, so if the target is reconfigured while the scan is running we may miss a Attached Namespace Attribute Changed AEN. Check if the NVME_AER_NOTICE_NS_CHANGED bit is set once the scan has finished, and requeue scanning to pick up any missed change. Signed-off-by: Hannes Reinecke Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index cc23035148b4..dc298de76de1 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4295,6 +4295,10 @@ static void nvme_scan_work(struct work_struct *work) nvme_scan_ns_sequential(ctrl); } mutex_unlock(&ctrl->scan_lock); + + /* Requeue if we have missed AENs */ + if (test_bit(NVME_AER_NOTICE_NS_CHANGED, &ctrl->events)) + nvme_queue_scan(ctrl); } /*