diff options
author | Keith Busch <kbusch@kernel.org> | 2020-09-24 13:53:28 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-10-13 15:05:05 -0600 |
commit | 3b481d91356e5693d8358d4ef9c383bdb92c8da0 (patch) | |
tree | afedde5da48885555103d2324c064777e024011a /block | |
parent | 47be77c2f80412f903134a57caea25fa3fc5f578 (diff) | |
download | linux-3b481d91356e5693d8358d4ef9c383bdb92c8da0.tar.gz linux-3b481d91356e5693d8358d4ef9c383bdb92c8da0.tar.bz2 linux-3b481d91356e5693d8358d4ef9c383bdb92c8da0.zip |
block: add zone specific block statuses
A zoned device with limited resources to open or activate zones may
return an error when the host exceeds those limits. The same command may
be successful if retried later, but the host needs to wait for specific
zone states before it should expect a retry to succeed. Have the block
layer provide an appropriate status for these conditions so applications
can distinuguish this error for special handling.
Cc: linux-api@vger.kernel.org
Cc: Niklas Cassel <niklas.cassel@wdc.com>
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index ac00d2fa4eb4..2db8bda43b6e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -186,6 +186,10 @@ static const struct { /* device mapper special case, should not leak out: */ [BLK_STS_DM_REQUEUE] = { -EREMCHG, "dm internal retry" }, + /* zone device specific errors */ + [BLK_STS_ZONE_OPEN_RESOURCE] = { -ETOOMANYREFS, "open zones exceeded" }, + [BLK_STS_ZONE_ACTIVE_RESOURCE] = { -EOVERFLOW, "active zones exceeded" }, + /* everything else not covered above: */ [BLK_STS_IOERR] = { -EIO, "I/O" }, }; |