[PATCH 3/3] nvme-fabrics: prevent overriding of existing host

Max Gurtovoy mgurtovoy at nvidia.com
Thu May 11 06:26:55 PDT 2023



On 11/05/2023 16:16, Christoph Hellwig wrote:
> On Wed, May 10, 2023 at 09:02:31PM +0300, Max Gurtovoy wrote:
>> When first connecting a target using the "default" host parameters,
>> setting the hostid from the command line during a subsequent connection
>> establishment would override the "default" hostid parameter. This would
>> cause an existing connection that is already using the host definitions
>> to lose its hostid.
> 
> We need to reject that second connect - hostids and hostnqns should
> have a 1:1 relationship.

I first though this way too but the specification allows an NQN to have 
logical partitions marked as hostIds:

NVMe over fabrics spec 1.1a section 3.3 (p 27):

"A host that uses a single Host NQN may employ multiple Host Identifiers 
to designate elements of the host that access an NVM subsystem 
independently of each other (e.g., physical or logical partitions of the 
host). Alternatively, a host may employ multiple Host NQN values to 
cause each element to be treated as a separate host by an NVM subsystem."

And actually this was probably the idea of the initial implementation in 
the driver.

I've just fixed the bug in the implementation.



More information about the Linux-nvme mailing list