[PATCH 05/17] nvme: wire-up support for async-passthru on char-device.
Clay Mayers
Clay.Mayers at kioxia.com
Tue Mar 22 08:18:03 PDT 2022
> From: Kanchan Joshi
> Sent: Tuesday, March 8, 2022 7:21 AM
> To: axboe at kernel.dk; hch at lst.de; kbusch at kernel.org;
> asml.silence at gmail.com
> Cc: io-uring at vger.kernel.org; linux-nvme at lists.infradead.org; linux-
> block at vger.kernel.org; sbates at raithlin.com; logang at deltatee.com;
> pankydev8 at gmail.com; javier at javigon.com; mcgrof at kernel.org;
> a.manzanares at samsung.com; joshiiitr at gmail.com; anuj20.g at samsung.com
> Subject: [PATCH 05/17] nvme: wire-up support for async-passthru on char-
> device.
>
<snip>
> +static void nvme_pt_task_cb(struct io_uring_cmd *ioucmd)
> +{
> + struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd);
> + struct request *req = pdu->req;
> + int status;
> + struct bio *bio = req->bio;
> +
> + if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
> + status = -EINTR;
> + else
> + status = nvme_req(req)->status;
> +
> + /* we can free request */
> + blk_mq_free_request(req);
> + blk_rq_unmap_user(bio);
> +
> + if (!status && pdu->meta_buffer) {
> + if (copy_to_user(pdu->meta_buffer, pdu->meta, pdu-
> >meta_len))
This copy is incorrectly called for writes.
> + status = -EFAULT;
> + }
> + kfree(pdu->meta);
> +
> + io_uring_cmd_done(ioucmd, status);
> +}
</snip>
More information about the Linux-nvme
mailing list