[PATCH 08/14] nvmet: use nvme write cmd group setting op_flag
Logan Gunthorpe
logang at deltatee.com
Mon Aug 10 19:23:47 EDT 2020
On 2020-08-10 5:08 p.m., Chaitanya Kulkarni wrote:
>>> +static inline bool nvmet_write_cmd_group(__u8 opcode)
>>> +{
>>> + bool ret;
>>> +
>>> + /* NVM Express Revision 1.4 Figure 462. */
>>> + switch (opcode) {
>>> + case nvme_admin_format_nvm:
>>> + case nvme_admin_ns_attach:
>>> + case nvme_admin_ns_mgmt:
>>> + case nvme_admin_sanitize_nvm:
>>> + case nvme_admin_security_send:
>>
>> All of these admin commands are rejected as INVALID_OPCODE in
>> nvmet_parse_passthru_admin_cmd(). So adding them here seems confusing at
>> best.
>>
>
> These are extremely important commands, why these commands are
> rejected ?
In some cases we were worried about side effects with other hosts
accessing the namespace, in others they require using the ctrl_id which
isn't really mapped in a sane way.
> What is the use of passthru if host cannot create namespaces format ns
> and sanitize the important data ?
Plenty, they can format the ns on the native host and still use them on
other targets.
> Irrespective of that it better have it documented there is no harm.
We shouldn't have code that doesn't actually do anything. It's confusing
and bad practice.
Logan
More information about the Linux-nvme
mailing list