[PATCH] nvme-core: mark passthru requests RQF_QUIET flag

Keith Busch kbusch at kernel.org
Wed Apr 6 10:21:58 PDT 2022


On Wed, Apr 06, 2022 at 05:01:46PM +0000, Chaitanya Kulkarni wrote:
> On 4/6/22 09:52, Keith Busch wrote:
> > On Wed, Apr 06, 2022 at 09:41:09AM -0700, Chaitanya Kulkarni wrote:
> >> @@ -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;
> > 
> > This defeats the admin error logging logic since every admin command comes
> > through here. If you're sure we should do this, then I suppose you can remove
> > that unreachable code.
> 
> If you point out the unreachable code that will be great,
> I'll keep looking meanwhile...

The second half of nvme_log_error(), plus nvme_get_admin_opcode_str() and the
array it defines are unreachable since all admin commands don't log errors with
this change.

You could skip the RQF_QUIET setting and check blk_rq_is_passthrough() instead.



More information about the Linux-nvme mailing list