Skip to content

Commit 9546ad1

Browse files
Hannes ReineckeChristoph Hellwig
authored andcommitted
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 <[email protected]> Reviewed-by: Keith Busch <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 72070e5 commit 9546ad1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4295,6 +4295,10 @@ static void nvme_scan_work(struct work_struct *work)
42954295
nvme_scan_ns_sequential(ctrl);
42964296
}
42974297
mutex_unlock(&ctrl->scan_lock);
4298+
4299+
/* Requeue if we have missed AENs */
4300+
if (test_bit(NVME_AER_NOTICE_NS_CHANGED, &ctrl->events))
4301+
nvme_queue_scan(ctrl);
42984302
}
42994303

43004304
/*

0 commit comments

Comments
 (0)