[PATCH] nvme: module parameter to disable pi checks

Keith Busch kbusch at kernel.org
Thu Oct 24 08:19:07 PDT 2024


On Thu, Oct 24, 2024 at 11:40:11AM +0530, Kanchan Joshi wrote:
> On 10/23/2024 9:20 PM, Keith Busch wrote:
> > @@ -1763,6 +1767,7 @@ static bool nvme_init_integrity(struct nvme_ns_head *head,
> >   		struct queue_limits *lim, struct nvme_ns_info *info)
> >   {
> >   	struct blk_integrity *bi = &lim->integrity;
> > +	int pi_type = head->pi_type;
> >   
> >   	memset(bi, 0, sizeof(*bi));
> >   
> > @@ -1777,7 +1782,10 @@ static bool nvme_init_integrity(struct nvme_ns_head *head,
> >   	    !(head->features & NVME_NS_METADATA_SUPPORTED))
> >   		return nvme_ns_has_pi(head);
> >   
> > -	switch (head->pi_type) {
> > +	if (disable_pi)
> > +		pi_type = 0;
> 
> I think this will not give the desired outcome. Since, regardless of the 
> nop profile, driver continues to send PRCHK_GUARD/REF to the device 
> during nvme_setup_rw. And you will continue to see read-failures.

Oh, I tested this and I thought it was working, but that was only
because it was a freshly formated drive. Yeah, I see what you're saying.
I'll fix it up.

> Also in current boolean form, "disable_pi" will do its thing on all 
> connected nvme devices. Should we make this fine granular. Like this 
> patch [2]?

Let's just make it specific to pi offsets. That's the only format that
I'm hearing problems with, so no need to make this a solution to a
problem no one has.



More information about the Linux-nvme mailing list