Re: [PATCH v2] nvme: remove stale namespaces by NSID range during scan

From: Keith Busch

Date: Mon Aug 24 2026 - 20:55:49 EST


On Sat, Aug 22, 2026 at 05:46:41PM -0700, Mohamed Khalfella wrote:
> nvme_scan_ns_list() drops the stale namespaces in each gap in the
> reported NSID list one NSID at a time. Every iteration calls
> nvme_find_get_ns() to look the namespace up and removes it if it is
> present. The loop runs once per NSID in the gap rather than once per
> namespace actually present.
>
> NSIDs are 32-bit, so a target with a sparse NSID space can make a
> single gap spin the loop billions of times with nothing to remove.

Thanks, applied to nvme-7.3.