linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmet: remove unsupported command noise
@ 2021-04-29  4:25 Keith Busch
  2021-04-29  6:36 ` Klaus Jensen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Keith Busch @ 2021-04-29  4:25 UTC (permalink / raw)
  To: linux-nvme, hch, sagi, chaitanya.kulkarni; +Cc: Keith Busch, Yi Zhang

Nothing can stop a host from submitting invalid commands. The target
just needs to respond with an appropriate status, but that's not a
target error. Demote invalid command messages to the debug level so
these events don't spam the kernel logs.

Reported-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/target/admin-cmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index d2a26ff3f7b3..8175b61ae0a3 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -307,7 +307,7 @@ static void nvmet_execute_get_log_page(struct nvmet_req *req)
 	case NVME_LOG_ANA:
 		return nvmet_execute_get_log_page_ana(req);
 	}
-	pr_err("unhandled lid %d on qid %d\n",
+	pr_debug("unhandled lid %d on qid %d\n",
 	       req->cmd->get_log_page.lid, req->sq->qid);
 	req->error_loc = offsetof(struct nvme_get_log_page_command, lid);
 	nvmet_req_complete(req, NVME_SC_INVALID_FIELD | NVME_SC_DNR);
@@ -659,7 +659,7 @@ static void nvmet_execute_identify(struct nvmet_req *req)
 		return nvmet_execute_identify_desclist(req);
 	}
 
-	pr_err("unhandled identify cns %d on qid %d\n",
+	pr_debug("unhandled identify cns %d on qid %d\n",
 	       req->cmd->identify.cns, req->sq->qid);
 	req->error_loc = offsetof(struct nvme_identify, cns);
 	nvmet_req_complete(req, NVME_SC_INVALID_FIELD | NVME_SC_DNR);
@@ -977,7 +977,7 @@ u16 nvmet_parse_admin_cmd(struct nvmet_req *req)
 		return 0;
 	}
 
-	pr_err("unhandled cmd %d on qid %d\n", cmd->common.opcode,
+	pr_debug("unhandled cmd %d on qid %d\n", cmd->common.opcode,
 	       req->sq->qid);
 	req->error_loc = offsetof(struct nvme_common_command, opcode);
 	return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
-- 
2.25.4


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvmet: remove unsupported command noise
  2021-04-29  4:25 [PATCH] nvmet: remove unsupported command noise Keith Busch
@ 2021-04-29  6:36 ` Klaus Jensen
  2021-04-29 18:17 ` Chaitanya Kulkarni
  2021-05-04  7:41 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Klaus Jensen @ 2021-04-29  6:36 UTC (permalink / raw)
  To: Keith Busch; +Cc: linux-nvme, hch, sagi, chaitanya.kulkarni, Yi Zhang


[-- Attachment #1.1: Type: text/plain, Size: 1991 bytes --]

On Apr 28 21:25, Keith Busch wrote:
>Nothing can stop a host from submitting invalid commands. The target
>just needs to respond with an appropriate status, but that's not a
>target error. Demote invalid command messages to the debug level so
>these events don't spam the kernel logs.
>
>Reported-by: Yi Zhang <yi.zhang@redhat.com>
>Signed-off-by: Keith Busch <kbusch@kernel.org>
>---
> drivers/nvme/target/admin-cmd.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
>index d2a26ff3f7b3..8175b61ae0a3 100644
>--- a/drivers/nvme/target/admin-cmd.c
>+++ b/drivers/nvme/target/admin-cmd.c
>@@ -307,7 +307,7 @@ static void nvmet_execute_get_log_page(struct nvmet_req *req)
> 	case NVME_LOG_ANA:
> 		return nvmet_execute_get_log_page_ana(req);
> 	}
>-	pr_err("unhandled lid %d on qid %d\n",
>+	pr_debug("unhandled lid %d on qid %d\n",
> 	       req->cmd->get_log_page.lid, req->sq->qid);
> 	req->error_loc = offsetof(struct nvme_get_log_page_command, lid);
> 	nvmet_req_complete(req, NVME_SC_INVALID_FIELD | NVME_SC_DNR);
>@@ -659,7 +659,7 @@ static void nvmet_execute_identify(struct nvmet_req *req)
> 		return nvmet_execute_identify_desclist(req);
> 	}
>
>-	pr_err("unhandled identify cns %d on qid %d\n",
>+	pr_debug("unhandled identify cns %d on qid %d\n",
> 	       req->cmd->identify.cns, req->sq->qid);
> 	req->error_loc = offsetof(struct nvme_identify, cns);
> 	nvmet_req_complete(req, NVME_SC_INVALID_FIELD | NVME_SC_DNR);
>@@ -977,7 +977,7 @@ u16 nvmet_parse_admin_cmd(struct nvmet_req *req)
> 		return 0;
> 	}
>
>-	pr_err("unhandled cmd %d on qid %d\n", cmd->common.opcode,
>+	pr_debug("unhandled cmd %d on qid %d\n", cmd->common.opcode,
> 	       req->sq->qid);
> 	req->error_loc = offsetof(struct nvme_common_command, opcode);
> 	return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
>-- 
>2.25.4
>

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvmet: remove unsupported command noise
  2021-04-29  4:25 [PATCH] nvmet: remove unsupported command noise Keith Busch
  2021-04-29  6:36 ` Klaus Jensen
@ 2021-04-29 18:17 ` Chaitanya Kulkarni
  2021-05-04  7:41 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2021-04-29 18:17 UTC (permalink / raw)
  To: Keith Busch, linux-nvme, hch, sagi; +Cc: Yi Zhang

On 4/28/21 21:26, Keith Busch wrote:
> Nothing can stop a host from submitting invalid commands. The target
> just needs to respond with an appropriate status, but that's not a
> target error. Demote invalid command messages to the debug level so
> these events don't spam the kernel logs.
>
> Reported-by: Yi Zhang <yi.zhang@redhat.com>
> Signed-off-by: Keith Busch <kbusch@kernel.org>

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>



_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvmet: remove unsupported command noise
  2021-04-29  4:25 [PATCH] nvmet: remove unsupported command noise Keith Busch
  2021-04-29  6:36 ` Klaus Jensen
  2021-04-29 18:17 ` Chaitanya Kulkarni
@ 2021-05-04  7:41 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2021-05-04  7:41 UTC (permalink / raw)
  To: Keith Busch; +Cc: linux-nvme, hch, sagi, chaitanya.kulkarni, Yi Zhang

Thanks,

applied to nvme-5.13.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-04  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29  4:25 [PATCH] nvmet: remove unsupported command noise Keith Busch
2021-04-29  6:36 ` Klaus Jensen
2021-04-29 18:17 ` Chaitanya Kulkarni
2021-05-04  7:41 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).