[PATCHv2 2/2] nvme: translate zone resource errors

Damien Le Moal Damien.LeMoal at wdc.com
Tue Sep 15 19:56:46 EDT 2020


On 2020/09/16 3:17, Keith Busch wrote:
> Translate zoned resource errors to the appropriate blk_status_t.
> 
> Signed-off-by: Keith Busch <kbusch at kernel.org>
> ---
> v1->v2:
> 
>   Use BLK_STS_ZONE_RESOURCE instead of BLK_STS_DEV_RESOURCE
> 
>  drivers/nvme/host/core.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index f3a61a24d45f..6d5c95a3e03c 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -236,6 +236,9 @@ static blk_status_t nvme_error_status(u16 status)
>  		return BLK_STS_NEXUS;
>  	case NVME_SC_HOST_PATH_ERROR:
>  		return BLK_STS_TRANSPORT;
> +	case NVME_SC_ZONE_TOO_MANY_ACTIVE:
> +	case NVME_SC_ZONE_TOO_MANY_OPEN:
> +		return BLK_STS_ZONE_RESOURCE;

BLK_STS_ZONE_RESOURCE is used in the submission path to tell the block layer to
"try again later because the target zone is locked". This is used by scsi for
zone append emulation. So I think it may be better to define
BLK_STS_DEV_ZONE_RESOURCE to avoid confusions, and that would also clearly
indicate that the status comes from a command failed by the device, not the
stack. Thoughts ?


>  	default:
>  		return BLK_STS_IOERR;
>  	}
> 


-- 
Damien Le Moal
Western Digital Research



More information about the Linux-nvme mailing list