[PATCHv2 1/2] block: map BLK_STS_ZONE_RESOURCE to errno
Damien Le Moal
Damien.LeMoal at wdc.com
Tue Sep 15 19:59:07 EDT 2020
On 2020/09/16 3:20, Keith Busch wrote:
> 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" },
OK. I think this is somewhat matching. The error message that strerrror()
returns for this error will be somewhat obscure to users though. We need to
document this.
> +
> /* everything else not covered above: */
> [BLK_STS_IOERR] = { -EIO, "I/O" },
> };
>
--
Damien Le Moal
Western Digital Research
More information about the Linux-nvme
mailing list