[bug report]nvme0: Admin Cmd(0x6), I/O Error (sct 0x0 / sc 0x2) MORE DNR observed during blktests

Alan Adamson alan.adamson at oracle.com
Tue Apr 5 12:09:59 PDT 2022



> On Apr 4, 2022, at 11:14 PM, Christoph Hellwig <hch at infradead.org> wrote:
> 
> On Mon, Apr 04, 2022 at 02:30:12PM -0600, Keith Busch wrote:
>>> Eg, nvme0: blah blah command set not supported
>> 
>> The new print in the completion handler is pretty generic. I don't think it can
>> readily tell the difference from a harmless error. Maybe pr_err is too high?
>> 
>> Or maybe since enough people have been concerned about *this* specific
>> identify, maybe it should be restricted to 2.0 devices where it's mandatory. I
>> was reluctant to do that at first since the initial device I tested was 1.4,
>> but it was a prototype and we should be fine without the non-mdts limits
>> anyway.
> 
> What SCSI does is to add RQF_QUIET to all internal passthrough commands,
> and then skips printing the SCSI specific error messages in addition
> if that flag is set.
> 
> This would be the nvme version of that:
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 7e07dd69262a7..9346cd4cf5820 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -366,7 +366,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);
> @@ -648,6 +649,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);
> 

I tested the change with an instrumented qemu emulated device.

Without the change:

# dmesg | grep -i nvme
[    3.610944] nvme nvme0: pci function 0000:00:04.0
[    3.685467] nvme0: Identify(0x6), Invalid Field in Command (sct 0x0 / sc 0x2) DNR
[    3.687850] nvme nvme0: 1/0/0 default/read/poll queues


With the change:

# dmesg | grep -i nvme
[    3.437014] nvme nvme0: pci function 0000:00:04.0
[    3.506572] nvme nvme0: 1/0/0 default/read/poll queues


Would you like me to submit the patch?

Alan







More information about the Linux-nvme mailing list