[PATCHv2 1/2] block: map BLK_STS_ZONE_RESOURCE to errno

Keith Busch kbusch at kernel.org
Tue Sep 15 14:12:29 EDT 2020


A zoned device with limited resources to open zones for writing may
return an error when the host exceeds those limits. Provide an
appropriate errno for this condition for drivers that return the zone
resource block status error when the device responds with these
conditions.

Signed-off-by: Keith Busch <kbusch at kernel.org>
---
v1->v2:

  Pick an errno to map BLK_STS_ZONE_RESOURCE

 block/blk-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index 10c08ac50697..3594efe05117 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -186,6 +186,9 @@ static const struct {
 	/* device mapper special case, should not leak out: */
 	[BLK_STS_DM_REQUEUE]	= { -EREMCHG, "dm internal retry" },
 
+	/* too many zone resources in use */
+	[BLK_STS_ZONE_RESOURCE]	= { -ETOOMANYREFS, "zone resource exceeded" },
+
 	/* everything else not covered above: */
 	[BLK_STS_IOERR]		= { -EIO,	"I/O" },
 };
-- 
2.24.1




More information about the Linux-nvme mailing list