[RFC 3/3] nvme : Add ioctl to query nvme attributes

Keith Busch kbusch at kernel.org
Fri Oct 28 09:22:35 PDT 2022


On Fri, Oct 28, 2022 at 05:52:30PM +0200, Joel Granados wrote:
> On Fri, Oct 28, 2022 at 08:52:01AM -0600, Keith Busch wrote:
> > On Fri, Oct 28, 2022 at 12:38:27PM +0200, Joel Granados wrote:
> > > 3. And the variables that are not in struct nvme_ctrl. Here, we have not
> > >    option but to make an IO.
> > 
> > You do have another option: we have historically added new fields to
> > nvme_ctrl to cache parameters that are repeatedly referenced in other
> > contexts, and this usage appears to qualify.
> 
> Agreed. That is yet another option. Will do that for my V1.
> Thx for the feedback

Just for the record, I don't really like this approach, but I don't have
a better suggestion right now other than opening up the admin queue or
exporting a ton of sysfs attributes (and each carry a different set of
concerns..).

My concern here is that drives implementing new specs may have new
constraints that applications need to know, but older kernels won't
accomodate. You are handling this by error'ing out the query, so it
relies on the application implementing a sane fallback (assuming such a
fallback for future attributes even exists). This just does not feel
very future-proof.



More information about the Linux-nvme mailing list