[PATCH] nvme-core: mark passthru requests RQF_QUIET flag
Chaitanya Kulkarni
kch at nvidia.com
Wed Apr 6 09:41:09 PDT 2022
From: Christoph Hellwig <hch at lst.de>
Since addition of the nvme_log_error() we are getting error message
when running block tests framework due to internal passthru commands :-
[ 612.754938] nvme nvme1: Removing ctrl: NQN "blktests-subsystem-1"
[ 616.361730] run blktests nvme/012 at 2022-04-06 09:26:43
[ 616.382902] loop0: detected capacity change from 0 to 2097152
[ 616.392680] nvmet: adding nsid 1 to subsystem blktests-subsystem-1
[ 616.400913] nvmet: creating nvm controller 1 for subsystem blktests-subsystem-1 for NQN testhostnqn.
[ 616.401001] nvme1: Identify(0x6), Invalid Field in Command (sct 0x0 / sc 0x2) MORE DNR
[ 627.427947] nvmet: adding nsid 1 to subsystem blktests-subsystem-1
[ 627.437084] nvmet: creating nvm controller 1 for subsystem blktests-subsystem-1 for NQN testhostnqn.
[ 627.437161] nvme1: Identify(0x6), Invalid Field in Command (sct 0x0 / sc 0x2) MORE DNR
[ 627.438984] nvme nvme1: creating 48 I/O queues.
[ 627.442620] nvme nvme1: new ctrl: "blktests-subsystem-1"
[ 628.506885] XFS (nvme1n1): Mounting V5 Filesystem
[ 628.516895] XFS (nvme1n1): Ending clean mount
[ 628.519966] xfs filesystem being mounted at /mnt/blktests supports timestamps until 2038 (0x7fffffff)
[ 704.852721] XFS (nvme1n1): Unmounting Filesystem
[ 704.864724] nvme nvme1: Removing ctrl: NQN "blktests-subsystem-1"
This patch adds the passthru request with RQF_QUIET flag and ignores
the error reporting for nvme_log_error() if RQF_QUIET flag is set
when request is failed. With this patch we don't get the above error
message.
Signed-off-by: Chaitanya Kulkarni <kch at nvidia.com>
[kch: make a formal patch & test with blktests]
Signed-off-by: Christoph Hellwig <hch at lst.de>
---
drivers/nvme/host/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index f204c6f78b5b..b913a89c743e 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -370,7 +370,8 @@ static inline void nvme_end_req(struct request *req)
{
blk_status_t status = nvme_error_status(nvme_req(req)->status);
- if (unlikely(nvme_req(req)->status != NVME_SC_SUCCESS))
+ if (unlikely(nvme_req(req)->status != NVME_SC_SUCCESS &&
+ !(req->rq_flags & RQF_QUIET)))
nvme_log_error(req);
nvme_end_req_zoned(req);
nvme_trace_bio_complete(req);
@@ -651,6 +652,7 @@ void nvme_init_request(struct request *req, struct nvme_command *cmd)
cmd->common.flags &= ~NVME_CMD_SGL_ALL;
req->cmd_flags |= REQ_FAILFAST_DRIVER;
+ req->rq_flags |= RQF_QUIET;
if (req->mq_hctx->type == HCTX_TYPE_POLL)
req->cmd_flags |= REQ_POLLED;
nvme_clear_nvme_request(req);
--
2.29.0
More information about the Linux-nvme
mailing list