Skip to contentSkip to conversation

nvme-status: Don't reduce all negative statuses to ECOMM

PATCH Superseded Sagi Grimberg 2 participants 3 messages Sep 9, 2020 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

PATCH 1/1 nvme-status: Don't reduce all negative statuses to ECOMM

There should be no reason why we should reduce all the semantic status codes we are getting from the device/driver to a single meaningless status code.

---
 nvme-status.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nvme-status.c +1 -1
index a78c1fd02797..29982541466d 100644
@@ -142,7 +142,7 @@ __u8 nvme_status_to_errno(int status, bool fabrics)
 		return 0;
 
 	if (status < 0)
-		return ECOMM;
+		return status;
 
 	/*
 	 * The actual status code is enough with masking 0xff, but we need to
Signature · 7 lines
2.25.1


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
maintainer
#1 lore raw
Quoted 14 lines · Sagi Grimberg

There should be no reason why we should reduce all the semantic status codes we are getting from the device/driver to a single meaningless status code.

---
 nvme-status.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nvme-status.c +0 -0
index a78c1fd02797..29982541466d 100644

nvme-status.c __u8 nvme_status_to_errno(int status, bool fabrics) · line 145

Quoted 5 lines
nvme-status.c +1 -1
@@ -142,7 +142,7 @@ __u8 nvme_status_to_errno(int status, bool fabrics)
 		return 0;
 
 	if (status < 0)
-		return ECOMM;
+		return status;

Shouldn't this be 'return errno' instead?

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

author maintainer
#2 lore raw
Quoted 17 lines
Quoted 17 lines

There should be no reason why we should reduce all the semantic status codes we are getting from the device/driver to a single meaningless status code.

---
  nvme-status.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
nvme-status.c +0 -0
index a78c1fd02797..29982541466d 100644
@@ -142,7 +142,7 @@ __u8 nvme_status_to_errno(int status, bool fabrics)
  		return 0;
 
Quoted 5 lines

nvme-status.c __u8 nvme_status_to_errno(int status, bool fabrics) · line 145

Quoted 3 lines
nvme-status.c +1 -1
  	if (status < 0)
-		return ECOMM;
+		return status;

Shouldn't this be 'return errno' instead?

Probably, yes. Let me do a quick test and verify.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme