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

Kanchan Joshi joshiiitr at gmail.com
Wed Oct 18 09:50:10 PDT 2023


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).



More information about the Linux-nvme mailing list