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

From: Tokunori Ikegami

Date: Mon May 25 2026 - 12:50:55 EST


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.