nvme-fabrics: fix un-expected behaviour related to hostnqn and hostid
Status from this message: Thanks, applied to nvme-6.5.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 2 repliesApplied
- v23 patches 10 repliesSuperseded
- v13 patches 7 repliesSuperseded
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | nvme-fabrics: unify common code in admin and io queue connectdrivers/ | +43 | 0 replies | |
| 2/3 | nvme-fabrics: check hostid using uuid_equaldrivers/ | +1 | 0 replies | |
| 3/3 | nvme-fabrics: prevent overriding of existing hostdrivers/ | +71 | 1 reply |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Noam Gottlieb | Israel Rukshin | Hannes Reinecke | Christoph Hellwig |
|---|---|---|---|---|
| 1/3 | T-b | R-b | R-b | R-b |
| 2/3 | T-b | R-b | R-b | R-b |
| 3/3 | T-b | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v3 0/3] nvme-fabrics: fix un-expected behaviour related to hostnqn and hostid
Hi Christoph/Sagi/Keith,
I've noticed that we are having some un-expected behaviour in some of the scenarios of connection establisment related to hostnqn and hostid. This is specially around overriding hostid for a host.
For example:
-------------
1. Connect to a target with default hostnqn and hostid (after removing the files from /etc/nvme):
- # nvme connect -t tcp -n testsubsystem_0 -a 1.1.1.1 -s 4420
2. Check hostnqn and hostid
- #cat /sys/class/nvme/nvme0/host*
1791bca2-af3c-4e17-a310-6fbdde3b59cb
nqn.2014-08.org.nvmexpress:uuid:fc4e5383-ce5c-470d-9889-4adbc2dbe9693. Connect to a target with given hostid from cmdline:
- # nvme connect -t tcp -n testsubsystem_0 -a 1.1.1.1 -s 4420 -I 77720af2-ce59-418b-82ff-7c9df0cea35e Failed to write to /dev/nvme-fabrics: Operation already in progress <--- failed on duplicate connection check
4. Check hostnqn and hostid of first controller
- #cat /sys/class/nvme/nvme0/host*
77720af2-ce59-418b-82ff-7c9df0cea35e <--- hostid was changed !!!!
nqn.2014-08.org.nvmexpress:uuid:fc4e5383-ce5c-470d-9889-4adbc2dbe969
5. Connect to a target with given hostid from cmdline and allow duplicate connections:
- # nvme connect -t tcp -n testsubsystem_0 -a 1.1.1.1 -s 4420 -I 77720af2-ce59-418b-82ff-7c9df0cea3bb -D
6. Check hostnqn and hostid of first controller again
- #cat /sys/class/nvme/nvme0/host*
77720af2-ce59-418b-82ff-7c9df0cea3bb <--- hostid was changed again !!!!
nqn.2014-08.org.nvmexpress:uuid:fc4e5383-ce5c-470d-9889-4adbc2dbe969This seems like a wrong behaviour to me since in case we try to reconnect the target will see that a different values after reconnections and this change the expected behaviour to keep hostid.
According to the spec:
"This feature allows the host to register a Host Identifier with the controller. The Host Identifier is used by the controller to determine whether other controllers in the NVM subsystem are associated with the same host.
"
Also:
"
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)
"
We've decided to implement 1:1 mapping for hostnqn and hostid to have unambiguous host identification even though the fabrics spec allows it.
These patchset fixes the current behaviour.
The first 2 patches are some preparations and cleanups and patch 3/3 is the actual fix.
Max Gurtovoy (3):
nvme-fabrics: unify common code in admin and io queue connect
nvme-fabrics: check hostid using uuid_equal
nvme-fabrics: prevent overriding of existing host
drivers/nvme/host/fabrics.c | 172 ++++++++++++++++++++++++------------ drivers/nvme/host/fabrics.h | 2 +- 2 files changed, 115 insertions(+), 59 deletions(-)
Signature · 1 line
2.18.1