[PATCH] nvme: fix error-handling for io_uring nvme-passthrough

Keith Busch kbusch at kernel.org
Wed Oct 18 09:59:33 PDT 2023


On Wed, Oct 18, 2023 at 10:20:10PM +0530, Kanchan Joshi wrote:
> On Wed, Oct 18, 2023 at 9:20 PM Christoph Hellwig <hch at lst.de> wrote:
> >
> > On Wed, Oct 18, 2023 at 07:27:18PM +0530, Kanchan Joshi wrote:
> > > @@ -508,8 +508,11 @@ static enum rq_end_io_ret nvme_uring_cmd_end_io(struct request *req,
> > >       req->bio = pdu->bio;
> > >       if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
> > >               pdu->nvme_status = -EINTR;
> > > -     else
> > > +     else {
> > >               pdu->nvme_status = nvme_req(req)->status;
> > > +             if (!pdu->nvme_status)
> > > +                     pdu->nvme_status = blk_status_to_errno(err);
> > > +     }
> >
> > Hmm, shoudn't err take precedence over the nvme status?
> 
> Since this is for passthrough interface, nvme status should get the
> precedence since that is what we want the users to see.
> Same happens for sync passthrough too (in nvme_execute_rq).

Right, blk_sts_t 'err' will be non-zero on any nvme error status, but we
want to report nvme error status if we have one.



More information about the Linux-nvme mailing list