[PATCH 2/4] nvme: refactor command completion

Christoph Hellwig hch at lst.de
Tue Aug 18 02:26:16 EDT 2020


On Mon, Aug 17, 2020 at 03:28:59PM -0400, Mike Snitzer wrote:
> > -	blk_status_t status = nvme_error_status(nvme_req(req)->status);
> > +	u16 status = nvme_req(req)->status & 0x7ff;
> >  
> > -	trace_nvme_complete_rq(req);
> > +	if (likely(status == 0))
> > +		return COMPLETE;
> >  
> > -	nvme_cleanup_cmd(req);
> > +	if (blk_noretry_request(req) || (status & NVME_SC_DNR) ||
> > +	    nvme_req(req)->retries >= nvme_max_retries)
> > +		return COMPLETE;
> 
> Looking just a bit closer, the above DNR test seems wrong because of the
> 0x7ff mask applied.  That mask drops access to NVME_SC_DNR right?

Indeed.  And the whole masking is rather pointless as
nvme_is_path_error already performs it as well..



More information about the Linux-nvme mailing list