Saw I/O errors while delete/create/attach a namespace on nvme device.
Keith Busch
kbusch at kernel.org
Tue Nov 7 07:18:17 PST 2023
On Tue, Nov 07, 2023 at 08:31:37AM -0600, Wen Xiong wrote:
>
> > To check exactly which id is problematic something like in [1] can be
> > used, totally untested ...
> >
> Steps:
> # nvme detach-ns /dev/nvme0 --namespace-id=1 --controllers=0x81
> # nvme delete-ns /dev/nvme0 --namespace-id=1
> # nvme create-ns /dev/nvme0 --nsze=562805846 --ncap=562805846 --flbas=0
> -dps=0 -nmic=1
> # nvme attach-ns /dev/nvme0 -n 1 --controller=0x81
>
> Below is linux log with your patch:
>
> [ 149.570987] nvme nvme0: rescanning namespaces.
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.
> [ 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.
More information about the Linux-nvme
mailing list