Re: [PATCH v5] nvme: reject passthrough of driver-managed Set Features
From: Christoph Hellwig
Date: Thu May 28 2026 - 04:48:27 EST
On Wed, May 27, 2026 at 08:32:08AM -0600, Keith Busch wrote:
> On Sat, May 23, 2026 at 06:56:29PM -0400, Chao Shi wrote:
> > + switch (le32_to_cpu(c->features.fid) & 0xff) {
> > + case NVME_FEAT_KATO:
> > + if (ctrl->ops->flags & NVME_F_FABRICS)
> > + break;
> > + fallthrough;
> > + case NVME_FEAT_HOST_BEHAVIOR:
> > + case NVME_FEAT_HOST_MEM_BUF:
> > + case NVME_FEAT_NUM_QUEUES:
> > + case NVME_FEAT_AUTO_PST:
>
> I may have been overly restrictive with suggesting AUTO_PST for this
> filter. Messing with the other features will break something, but power
> state is just user policy. The driver may undo the user setting on a
> controller reset, but so what?
There's really no point in allowing it. Just as we should have never
allowed low-level config of any kind, but unfortunately nvme admin
commands are a horrible grab all.