diff mbox series

[PATCHv3,2/4] nvme: translate zone resource errors

Message ID 20200917231841.4029747-3-kbusch@kernel.org
State New
Headers show
Series zoned block device specific errors | expand

Commit Message

Keith Busch Sept. 17, 2020, 11:18 p.m. UTC
Translate zoned resource errors to the appropriate blk_status_t.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/host/core.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Damien Le Moal Sept. 18, 2020, 12:30 a.m. UTC | #1
On 2020/09/18 8:18, Keith Busch wrote:
> Translate zoned resource errors to the appropriate blk_status_t.
> 
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Damien Le Moal <Damien.LeMoal@wdc.com>
> Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
>  drivers/nvme/host/core.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 614cd455836b..a0d26fcbf923 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -236,6 +236,10 @@ 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:
> +		return BLK_STS_ZONE_ACTIVE_RESOURCE;
> +	case NVME_SC_ZONE_TOO_MANY_OPEN:
> +		return BLK_STS_ZONE_OPEN_RESOURCE;
>  	default:
>  		return BLK_STS_IOERR;
>  	}
> 

Looks good.
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Johannes Thumshirn Sept. 18, 2020, 1:29 p.m. UTC | #2
Easy enough,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 614cd455836b..a0d26fcbf923 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -236,6 +236,10 @@  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:
+		return BLK_STS_ZONE_ACTIVE_RESOURCE;
+	case NVME_SC_ZONE_TOO_MANY_OPEN:
+		return BLK_STS_ZONE_OPEN_RESOURCE;
 	default:
 		return BLK_STS_IOERR;
 	}