[PATCH] nvme: fix PI insert on write

Kanchan Joshi joshi.k at samsung.com
Wed Aug 20 22:02:13 PDT 2025


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.




More information about the Linux-nvme mailing list