nvme: translate zone resource errors
authorKeith Busch <kbusch@kernel.org>
Thu, 24 Sep 2020 20:53:29 +0000 (13:53 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 13 Oct 2020 21:05:05 +0000 (15:05 -0600)
Translate zoned resource errors to the appropriate blk_status_t.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c

index 56e2a22e8a029922c03148cec77c066db3cc5251..95ef4943d8bd4c2b464909effab150479aa54685 100644 (file)
@@ -248,6 +248,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;
        }