[PATCH for-4.12] nvme/pci: Fix stuck nvme reset

Christoph Hellwig hch at lst.de
Tue Jun 27 16:40:19 PDT 2017


On Tue, Jun 27, 2017 at 07:43:38PM -0400, Keith Busch wrote:
> The controller state is set to resetting prior to disabling the
> controller, so this patch accounts for that state when deciding if it
> needs to freeze the queues. Without this, an 'nvme reset /dev/nvme0'
> blocks forever because the queues were never frozen.

Ouch.

> -		if (dev->ctrl.state == NVME_CTRL_LIVE)
> +		if (dev->ctrl.state == NVME_CTRL_LIVE ||
> +				dev->ctrl.state == NVME_CTRL_RESETTING)

Can you align this a little nicer:

		if (dev->ctrl.state == NVME_CTRL_LIVE ||
		    dev->ctrl.state == NVME_CTRL_RESETTING)

Otherwise this looks fine:

Reviewed-by: Christoph Hellwig <hch at lst.de>

Maybe Jens should pick this up directly for the block tree?  No
point in a nvme pull request just for this.



More information about the Linux-nvme mailing list