Re: [PATCH] nvme: Add support for ACRE Command Interrupted status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[cc'ing linux-block, Jens]

On Tue, Nov 26, 2019 at 02:36:50PM +0100, Hannes Reinecke wrote:
> This patch fixes a bug in nvme_complete_rq logic introduced by
> Enhanced Command Retry code. According to TP-4033 the controller
> only sets CDR when the Command Interrupted status is returned.
> The current code interprets Command Interrupted status as a
> BLK_STS_IOERR, which results in a controller reset if
> REQ_NVME_MPATH is set.

I see that Command Interrupted status requires ACRE enabled, but I don't
see the TP saying that the CQE CRD fields are used only with that status
code. I'm pretty sure I've seen it used for Namespace Not Ready status
as well. That would also fail MPATH for the same reason as this new
status...

> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 108f60b46804..752a40daf2b3 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -201,6 +201,8 @@ static blk_status_t nvme_error_status(u16 status)
>  	switch (status & 0x7ff) {
>  	case NVME_SC_SUCCESS:
>  		return BLK_STS_OK;
> +	case NVME_SC_COMMAND_INTERRUPTED:
> +		return BLK_STS_RESOURCE;
>  	case NVME_SC_CAP_EXCEEDED:
>  		return BLK_STS_NOSPC;
>  	case NVME_SC_LBA_RANGE:
> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
> index d688b96d1d63..3a0d84528325 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -84,6 +84,7 @@ static inline bool blk_path_error(blk_status_t error)
>  	case BLK_STS_NEXUS:
>  	case BLK_STS_MEDIUM:
>  	case BLK_STS_PROTECTION:
> +	case BLK_STS_RESOURCE:
>  		return false;
>  	}

I agree we need to make this status a non-path error, but we at least
need an Ack from Jens or have this patch go through linux-block if we're
changing BLK_STS_RESOURCE to mean a non-path error.

> diff --git a/include/linux/nvme.h b/include/linux/nvme.h
> index f61d6906e59d..6b21f3888cad 100644
> --- a/include/linux/nvme.h
> +++ b/include/linux/nvme.h
> @@ -1292,6 +1292,8 @@ enum {
>  
>  	NVME_SC_NS_WRITE_PROTECTED	= 0x20,
>  
> +	NVME_SC_COMMAND_INTERRUPTED	= 0x21,

This command status was actually already defined in commit
48c9e85b23464, though with a slightly different name.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux