nvme: translate zns errors to blk_status_t
Keith Busch
maintainerPATCH 1/1 nvme: translate zns errors to blk_status_t
EBUSY is the appropriate errno for commands that complete with zone resource errors.
--- drivers/nvme/host/core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/host/core.c +3 -0
@@ -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 ;default :return BLK_STS_IOERR ; }
Signature · 7 lines
2.24.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 14 lines · Keith Busch
EBUSY is the appropriate errno for commands that complete with zone resource errors.
Signed-off-by Keith Busch <[email protected]>--- drivers/nvme/host/core.c | 3 +++ 1 file changed, 3 insertions(+)drivers/nvme/host/core.c +0
-0
drivers/nvme/host/core.c static blk_status_t nvme_error_status(u16 status) · line 257
Quoted 9 lines
drivers/nvme/host/core.c +3
-0@@ -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 ;default :return BLK_STS_IOERR ; }
Perfect ! That fits nicely with what Johannes is working on with zonefs explicit zone open. I will check the scsi side to make sure the same is returned for too many open zones case.
Signature · 7 lines
Damien Le Moal Western Digital Research _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerQuoted 13 lines · Keith Busch
EBUSY is the appropriate errno for commands that complete with zone resource errors.
Signed-off-by Keith Busch <[email protected]>--- drivers/nvme/host/core.c | 3 +++ 1 file changed, 3 insertions(+)drivers/nvme/host/core.c +0
-0
drivers/nvme/host/core.c static blk_status_t nvme_error_status(u16 status) · line 254
Quoted 6 lines
drivers/nvme/host/core.c +3
-0@@ -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.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keith Busch
maintainerQuoted 9 lines · Christoph Hellwig
Quoted 8 lines · Keith Busch
EBUSY is the appropriate errno for commands that complete with zone resource errors.
Signed-off-by Keith Busch <[email protected]>--- drivers/nvme/host/core.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 14 lines
drivers/nvme/host/core.c static blk_status_t nvme_error_status(u16 status) · line 254
Quoted 11 lines
drivers/nvme/host/core.c +3
-0@@ -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.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · Keith Busch
EBUSY is the appropriate errno for commands that complete with zone resource errors.
Signed-off-by Keith Busch <[email protected]>--- drivers/nvme/host/core.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 14 lines
drivers/nvme/host/core.c static blk_status_t nvme_error_status(u16 status) · line 254
Quoted 11 lines
drivers/nvme/host/core.c +3
-0@@ -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.
Do you mean something else than -EBUSY being returned to the user by the block layer ? Or a different/specific BLK_STS_XXX code which translates into -EBUSY in blk_status_to_errno() ?
Signature · 7 lines
Damien Le Moal Western Digital Research _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerQuoted 6 lines · Damien Le Moal
Quoted 2 lines
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.
Do you mean something else than
-EBUSYbeing returned to the user by the block layer ? Or a different/specificBLK_STS_XXXcode which translates into-EBUSYinblk_status_to_errno()?
My primary aim is a different BLK_STS_ code. But given that I think that we should not map different BLK_STS_ codes to the same errno if we can avoid it, we should probably also use a different errno.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 4 lines · Christoph Hellwig
Quoted 3 lines · Damien Le Moal
Quoted 2 lines
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.
Quoted 8 lines
Quoted 3 lines
Do you mean something else than
-EBUSYbeing returned to the user by the block layer ? Or a different/specificBLK_STS_XXXcode which translates into-EBUSYinblk_status_to_errno()?My primary aim is a different
BLK_STS_code. But given that I think that we should not map differentBLK_STS_codes to the same errno if we can avoid it, we should probably also use a different errno.
Hmm. Beside EBUSY, I do not see a nice existing errno that we can reuse. May be ENOSR (out of stream resources) ? Or do we define a new one ? EZBUSY ?
And indeed if we define a new BLK_STS_ZONE_RESOURCE and map that to EBUSY, errno_to_blkstatus() will get confused.
Signature · 7 lines
Damien Le Moal Western Digital Research _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Keith Busch
maintainerQuoted 14 lines · Damien Le Moal
Quoted 4 lines · Christoph Hellwig
Quoted 3 lines · Damien Le Moal
Quoted 2 lines
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.
Quoted 8 lines
Quoted 3 lines
Do you mean something else than
-EBUSYbeing returned to the user by the block layer ? Or a different/specificBLK_STS_XXXcode which translates into-EBUSYinblk_status_to_errno()?My primary aim is a different
BLK_STS_code. But given that I think that we should not map differentBLK_STS_codes to the same errno if we can avoid it, we should probably also use a different errno.
Quoted 5 lines
Hmm. Beside EBUSY, I do not see a nice existing errno that we can reuse. May be ENOSR (out of stream resources) ? Or do we define a new one ? EZBUSY ?
And indeed if we define a new
BLK_STS_ZONE_RESOURCEand map that to EBUSY,errno_to_blkstatus()will get confused.
It's not often I get to help define a new errno, so I'm a bit cautious of that route. But if that's the recommendation, then sure, sounds fun.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerQuoted 14 lines · Damien Le Moal
Quoted 4 lines · Christoph Hellwig
Quoted 3 lines · Damien Le Moal
Quoted 2 lines
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.
Quoted 8 lines
Quoted 3 lines
Do you mean something else than
-EBUSYbeing returned to the user by the block layer ? Or a different/specificBLK_STS_XXXcode which translates into-EBUSYinblk_status_to_errno()?My primary aim is a different
BLK_STS_code. But given that I think that we should not map differentBLK_STS_codes to the same errno if we can avoid it, we should probably also use a different errno.
Quoted 5 lines
Hmm. Beside EBUSY, I do not see a nice existing errno that we can reuse. May be ENOSR (out of stream resources) ? Or do we define a new one ? EZBUSY ?
And indeed if we define a new
BLK_STS_ZONE_RESOURCEand map that to EBUSY,errno_to_blkstatus()will get confused.
Yes, you need to pick a new error. I don't really care which one, most of the mappings are pretty odd anyway.
Quoted 5 lines
Signature · 3 lines
-- Damien Le Moal Western Digital Research
---end quoted text---
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keith Busch
maintainerQuoted 15 lines · Christoph Hellwig
Quoted 14 lines · Damien Le Moal
Quoted 12 lines · Christoph Hellwig
Quoted 6 lines · Damien Le Moal
Quoted 2 lines
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.
Do you mean something else than
-EBUSYbeing returned to the user by the block layer ? Or a different/specificBLK_STS_XXXcode which translates into-EBUSYinblk_status_to_errno()?My primary aim is a different
BLK_STS_code. But given that I think that we should not map differentBLK_STS_codes to the same errno if we can avoid it, we should probably also use a different errno.
Quoted 8 lines
Quoted 5 lines
Hmm. Beside EBUSY, I do not see a nice existing errno that we can reuse. May be ENOSR (out of stream resources) ? Or do we define a new one ? EZBUSY ?
And indeed if we define a new
BLK_STS_ZONE_RESOURCEand map that to EBUSY,errno_to_blkstatus()will get confused.Yes, you need to pick a new error. I don't really care which one, most of the mappings are pretty odd anyway.
Selecting an existing unused errno feels a bit arbitrary for a status that is currently specific to NVMe ZNS. Could you provide a little more guidance on what you're looking for?
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 22 lines · Keith Busch
Quoted 21 lines · Christoph Hellwig
Quoted 19 lines · Damien Le Moal
Quoted 4 lines · Christoph Hellwig
Quoted 3 lines · Damien Le Moal
Quoted 2 lines
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.
Quoted 8 lines
Quoted 3 lines
Do you mean something else than
-EBUSYbeing returned to the user by the block layer ? Or a different/specificBLK_STS_XXXcode which translates into-EBUSYinblk_status_to_errno()?My primary aim is a different
BLK_STS_code. But given that I think that we should not map differentBLK_STS_codes to the same errno if we can avoid it, we should probably also use a different errno.Hmm. Beside EBUSY, I do not see a nice existing errno that we can reuse. May be ENOSR (out of stream resources) ? Or do we define a new one ? EZBUSY ?
And indeed if we define a new
BLK_STS_ZONE_RESOURCEand map that to EBUSY,errno_to_blkstatus()will get confused.
Quoted 6 lines
Quoted 2 lines
Yes, you need to pick a new error. I don't really care which one, most of the mappings are pretty odd anyway.
Selecting an existing unused errno feels a bit arbitrary for a status that is currently specific to NVMe ZNS. Could you provide a little more guidance on what you're looking for?
Not just NVMe ZNS. SCSI/ZBC and ATA/ZAC too (both sd driver) :)
Signature · 7 lines
Damien Le Moal Western Digital Research _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Keith Busch
maintainerQuoted 6 lines · Damien Le Moal
Quoted 3 lines · Keith Busch
Selecting an existing unused errno feels a bit arbitrary for a status that is currently specific to NVMe ZNS. Could you provide a little more guidance on what you're looking for?
Not just NVMe ZNS. SCSI/ZBC and ATA/ZAC too (both sd driver) :)
Gotcha, I did not realize those may have open zone limits too.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 9 lines · Keith Busch
Quoted 6 lines · Damien Le Moal
Quoted 3 lines · Keith Busch
Selecting an existing unused errno feels a bit arbitrary for a status that is currently specific to NVMe ZNS. Could you provide a little more guidance on what you're looking for?
Not just NVMe ZNS. SCSI/ZBC and ATA/ZAC too (both sd driver) :)
Gotcha, I did not realize those may have open zone limits too.
ZBC/ZAC both define a max open zone limit too, which is semantically equivalent to ZNS definition. ZBC and ZAC do not define the active zone concept though, so no limit set for max_active_zones.
Signature · 7 lines
Damien Le Moal Western Digital Research _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerQuoted 6 lines · Keith Busch
Quoted 2 lines
Yes, you need to pick a new error. I don't really care which one, most of the mappings are pretty odd anyway.
Selecting an existing unused errno feels a bit arbitrary for a status that is currently specific to NVMe ZNS. Could you provide a little more guidance on what you're looking for?
As said before: most of the errno mappins are pretty arbitrary, e.g. take a look at the -ENOLINK, -EREMOTEIO, -EBADE, -ENODATA, -EILSEQ, or -EREMCHG mappings.
So I think just picking a value like ECHRNG or EBADSLT or EUSERS should be perfectly fine.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme