[PATCH] nvme: translate zns errors to blk_status_t

Damien Le Moal Damien.LeMoal at wdc.com
Wed Sep 9 20:44:05 EDT 2020


On 2020/09/10 5:38, Keith Busch wrote:
> EBUSY is the appropriate errno for commands that complete with zone
> resource errors.
> 
> Signed-off-by: Keith Busch <kbusch at kernel.org>
> ---
>  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 ea1fa41fbba8..aff556837115 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -249,6 +249,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_DEV_RESOURCE;
>  	default:
>  		return BLK_STS_IOERR;
>  	}
> 

Perfect ! That fits nicely with what Johannes is working on with zonefs explicit
zone open. I will check the scsi side to make sure the same is returned for too
many open zones case.

Reviewed-by: Damien Le Moal <damien.lemoal at wdc.com>

-- 
Damien Le Moal
Western Digital Research



More information about the Linux-nvme mailing list