[PATCH] nvme: fix cns check

Keith Busch kbusch at kernel.org
Thu Oct 10 08:11:37 PDT 2024


On Thu, Oct 10, 2024 at 09:56:33AM +0200, Christoph Hellwig wrote:
> On Wed, Oct 09, 2024 at 02:40:35PM -0700, Keith Busch wrote:
> > From: Keith Busch <kbusch at kernel.org>
> > 
> > The 1.1 spec defined two bits for the Identify CNS field, so such an
> > implementation wouldn't be expected to check the full byte for a
> > decoding it. Provide a different helper function to make these
> > decisions as the existing check only separates the single-bit from the
> > two-bit spec versions.
> 
> I don't really understand what this is trying to solve.  Is there a
> controller in the wild reporting 1.1 compliance but reporting useful
> information in the NVM Command Set specific Identify Controller data
> structure?

It's not going to return anything useful. The 1.1 compliant controller
truncates Command Set Specific ID Ctrl (CNS 06h) to just two bits (2h),
believing the host requested the a namespace list, and the host will
think the success means it has different identification data.

I was only thinking about this because of the rotational media patches
were using the same criteria that would let a 1.1 complaint controller
see another Identify that will have a truncated CNS.



More information about the Linux-nvme mailing list