Saw I/O errors while delete/create/attach a namespace on nvme device.

Christoph Hellwig hch at infradead.org
Tue Nov 7 23:15:22 PST 2023


On Tue, Nov 07, 2023 at 08:18:17AM -0700, Keith Busch wrote:
> Are you running these commands in quick succession? There should be a
> "rescanning namespaces" message right after the 'detach-ns' command, and
> before subsequent 'attach-ns' command. It looks here that the rescan
> didn't run until after the 'attach-ns' occured. Instead of tearing down
> the original, the driver just sees the namespace it previously knew
> about has changed unexpectedly; the processing for the namespace removal
> didn't happen prior to the attach-ns command.

Yep.

> 
> > [  149.578714] nguid mismatch
> > [  149.578719] nvme nvme0: identifiers changed for nsid 1
> > [  149.582291] block nvme0n1: no usable path - requeuing I/O
> > [  149.722140] block nvme0n1: no available path - failing I/O
> > [  149.722157] block nvme0n1: no available path - failing I/O
> 
> If you drop all open references to /dev/nvme0n1, then the handle should
> get deleted, and a manual rescan after that should get your new
> namespace visible.

I fear we still need to handle this somehow.  For actual per-spec
namespce management we'll just need to snoop the namespace management
commands and update the ns_head membership.  For out of band management
there's not much we can do as-is.  A good addition to the spec would
be to add the concept of a namespace generation that is incremented
every time the nsid is reused.




More information about the Linux-nvme mailing list