[PATCH v1] nvme: do not log errors for user commands

Pankaj Raghav pankydev8 at gmail.com
Thu Oct 6 05:16:35 PDT 2022


On Thu, Oct 06, 2022 at 11:36:28AM +0200, Daniel Wagner wrote:
> 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.
<snip>
> @@ -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;

With this, we are disabling logging for ADMIN and IO commands via the
ioctl. IMO, the error logging for IO commands could be useful for
debugging. But I do understand your regression argument here.

>  	ret = nvme_execute_passthru_rq(req, &effects);
>  
>  	if (result)

We can also send admin commands via the uring_cmd interface:
nvme_dev_uring_cmd(). Should we also enable RQF_QUIET flags for them?

P.S: I sent a patch today that touches the error logging in NVMe that
sets the starting LBA as zero for IO passthrough requests.
https://lore.kernel.org/linux-nvme/20221006091053.36611-1-p.raghav@samsung.com/




More information about the Linux-nvme mailing list