Skip to contentSkip to conversation

nvme-auth: update error log in nvme_auth_submit()

PATCH Applied Martin George 3 participants 3 messages Oct 21

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-auth: update error log in nvme_auth_submit()

nvme_auth_submit() issues both AUTH Send and AUTH Receive commands, but the failure messages are hardcoded to "auth_send failed", which can be misleading when an AUTH Receive fails. So print the correct direction instead.

---
 drivers/nvme/host/auth.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/nvme/host/auth.c +4 -2
index cbb38935fa22..85f005a5efd0 100644
@@ -85,10 +85,12 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,
 				     qid == 0 ? NVME_QID_ANY : qid, flags);
 	if (ret > 0)
 		dev_warn(ctrl->device,
-			"qid %d auth_send failed with status %d\n", qid, ret);
+			"qid %d auth_%s failed with status %d\n",
+			qid, auth_send ? "send" : "receive", ret);
 	else if (ret < 0)
 		dev_err(ctrl->device,
-			"qid %d auth_send failed with error %d\n", qid, ret);
+			"qid %d auth_%s failed with error %d\n",
+			qid, auth_send ? "send" : "receive", ret);
 	return ret;
 }
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Martin George

nvme_auth_submit() issues both AUTH Send and AUTH Receive commands, but the failure messages are hardcoded to "auth_send failed", which can be misleading when an AUTH Receive fails. So print the correct direction instead.

---
  drivers/nvme/host/auth.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/nvme/host/auth.c +0 -1
index cbb38935fa22..85f005a5efd0 100644
@@ -85,10 +85,12 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,
  				     qid == 0 ? NVME_QID_ANY : qid, flags);
  	if (ret > 0)
  		dev_warn(ctrl->device,
-			"qid %d auth_send failed with status %d\n", qid, ret);

drivers/nvme/host/auth.c static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid, · line 96

Quoted 10 lines
drivers/nvme/host/auth.c +4 -1
+			"qid %d auth_%s failed with status %d\n",
+			qid, auth_send ? "send" : "receive", ret);
  	else if (ret < 0)
  		dev_err(ctrl->device,
-			"qid %d auth_send failed with error %d\n", qid, ret);
+			"qid %d auth_%s failed with error %d\n",
+			qid, auth_send ? "send" : "receive", ret);
  	return ret;
  }
 

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
maintainer Applied
#2 lore raw
In reply to Martin George
Quoted 4 lines · Martin George

nvme_auth_submit() issues both AUTH Send and AUTH Receive commands, but the failure messages are hardcoded to "auth_send failed", which can be misleading when an AUTH Receive fails. So print the correct direction instead.

Thanks, applied to nvme-7.4.