[PATCH] nvme: fix PI insert on write
Christoph Hellwig
hch at lst.de
Thu Aug 21 01:33:01 PDT 2025
On Thu, Aug 21, 2025 at 10:32:13AM +0530, Kanchan Joshi wrote:
> On 8/20/2025 8:09 PM, Keith Busch wrote:
> >> @@ -1039,6 +1039,7 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
> >> if (WARN_ON_ONCE(!nvme_ns_has_pi(ns->head)))
> >> return BLK_STS_NOTSUPP;
> >> control |= NVME_RW_PRINFO_PRACT;
> >> + nvme_set_ref_tag(ns, cmnd, req);
> >> }
> > Do we need to check that it's type 1 or 2 before setting this?
>
> Seems so.
> And if the check moves inside nvme_set_ref_tag(), it will keep
> current/future call-sites simple.
Yes, that was my thought as well when reading Keith' reply.
More information about the Linux-nvme
mailing list