[PATCH] nvme: translate zns errors to blk_status_t

Keith Busch kbusch at kernel.org
Thu Sep 10 10:45:34 EDT 2020


On Thu, Sep 10, 2020 at 07:26:43AM +0200, Christoph Hellwig wrote:
> On Wed, Sep 09, 2020 at 01:33:24PM -0700, Keith Busch wrote:
> > EBUSY is the appropriate errno for commands that complete with zone
> > resource errors.
> > 
> > Signed-off-by: Keith Busch <kbusch at kernel.org>
> > ---
> >  drivers/nvme/host/core.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> > index ea1fa41fbba8..aff556837115 100644
> > --- a/drivers/nvme/host/core.c
> > +++ b/drivers/nvme/host/core.c
> > @@ -249,6 +249,9 @@ 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:
> > +	case NVME_SC_ZONE_TOO_MANY_OPEN:
> > +		return BLK_STS_DEV_RESOURCE;
> 
> I'm not sure this is the best idea, we probably need specific error codes
> if we want file systems to be aware of the limit.

I was more considering the errno the user sees going direct to the
device.



More information about the Linux-nvme mailing list