[PATCH v5] nvme: reject passthrough of driver-managed Set Features

Tokunori Ikegami ikegami.t at gmail.com
Mon May 25 09:49:36 PDT 2026


On 2026/05/26 0:49, Keith Busch wrote:
> On Tue, May 26, 2026 at 12:34:03AM +0900, Tokunori Ikegami wrote:
>>> +static bool nvme_cmd_allowed(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
>>> +			     struct nvme_command *c, unsigned int flags,
>>> +			     bool open_for_write)
>> The struct nvme_ns does already have the struct nvme_ctrl *ctrl as a member
>> variable as below so seems not necessary to add the function argument struct
>> nvme_ctrl *ctrl.
> This filter is for admin commands, so the 'ns' parameter is NULL for
> this case.
Okay so how about that to use the function argument unsigned int flags 
instead with adding the NVME_IOCTL_FABRICS enum definition?
enum {
     NVME_IOCTL_VEC        = (1 << 0),
     NVME_IOCTL_PARTITION    = (1 << 1),
};
Note: I mean as possible as we can it seems better to avoid the many 
function arguments for the maintainability.
Thank you.



More information about the Linux-nvme mailing list