[PATCH v1] nvme: do not log errors for user commands
Daniel Wagner
dwagner at suse.de
Thu Oct 6 02:36:28 PDT 2022
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 at redhat.com
Reported-by: Tomas Bzatek <tbzatek at redhat.com>
Cc: Alan Adamson <alan.adamson at oracle.com>
Cc: Chaitanya Kulkarni <kch at nvidia.com>
Cc: Martin K. Petersen <martin.petersen at oracle.com>
Signed-off-by: Daniel Wagner <dwagner at 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
More information about the Linux-nvme
mailing list