linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] nvme: do not log errors for user commands
@ 2022-10-06  9:36 Daniel Wagner
  2022-10-06 12:16 ` Pankaj Raghav
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Wagner @ 2022-10-06  9:36 UTC (permalink / raw)
  To: linux-nvme
  Cc: Keith Busch, Daniel Wagner, yi.zhang, Tomas Bzatek, Alan Adamson,
	Chaitanya Kulkarni, Martin K . Petersen

User space might issue commands which fail. Even though userland
handles them correclty, these command get logged which irritates
users.

E.g. libnvme's nvme_scan_topology function is using Namespace
Identification Descriptor list (CNS Value 0x03) for discovering. It
handles the case where it fails but still the kernel logs this as
error:

 nvme0: Admin Cmd(0x6), I/O Error (sct 0x0 / sc 0x2) DNR
 nvme1: Admin Cmd(0x6), I/O Error (sct 0x0 / sc 0x2) DNR

This disables error logging via nvme_log_error for all passthrough
commands. Instead reverting the complete patch, let's disable this bit
until the interested parties in extended logging have figured out how
to do it without introducing regressions. Removing the now
non-functional part in nvme_log_error can be done later if needed.

Fixes: bd83fe6f2cd2 ("nvme: add verbose error logging")
Link: https://github.com/linux-nvme/libnvme/issues/485
Reported-by: yi.zhang@redhat.com
Reported-by: Tomas Bzatek <tbzatek@redhat.com>
Cc: Alan Adamson <alan.adamson@oracle.com>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---

v1:
 - SET RQF_QUIET flag instead of checking NVME_REQ_USERCMD in
   nvme_log_error.
v0:
 - https://lore.kernel.org/linux-nvme/20220929171338.10792-1-dwagner@suse.de/

 drivers/nvme/host/ioctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index a48a79ed5c4c..b2c1b73f0a22 100644
--- a/drivers/nvme/host/ioctl.c
+++ b/drivers/nvme/host/ioctl.c
@@ -151,6 +151,7 @@ static int nvme_submit_user_cmd(struct request_queue *q,
 	bio = req->bio;
 	ctrl = nvme_req(req)->ctrl;
 
+	req->rq_flags |= RQF_QUIET;
 	ret = nvme_execute_passthru_rq(req, &effects);
 
 	if (result)
-- 
2.37.3



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

end of thread, other threads:[~2022-10-17 16:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06  9:36 [PATCH v1] nvme: do not log errors for user commands Daniel Wagner
2022-10-06 12:16 ` Pankaj Raghav
2022-10-06 13:30   ` Daniel Wagner
2022-10-07 21:19     ` Alan Adamson
2022-10-10  7:36       ` Daniel Wagner
2022-10-17  7:07       ` Christoph Hellwig
2022-10-17 16:37         ` Keith Busch
2022-10-17 16:40           ` Alan Adamson

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).