Skip to content

Commit a8dfc5b

Browse files
Merge pull request #388 from martin-belanger/udev-test-for-tp8013
udev: Fix subsysnqn comparison (TP8013)
2 parents 71ab506 + 6b5e6a7 commit a8dfc5b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Bug fixes:
1515
* Udev event handling: use `systemctl restart` instead of `systemctl start`. There is a small chance that a `start` operation has not completed when a new `start` is required. Issuing a `start` while a `start` is being performed has no effect. However, a `restart` will be handled properly.
1616
* `stafd`: Do not delete and recreate DC objects on kernel events indicating that an nvme device associated to a discovery controller was removed by the kernel. This was done to kick start the reconnect process, but was also causing the DLPE (Discovery Log Page Entries) cache to be lost. This could potentially result in `stacd` disconnecting from I/O controllers. Instead, keep the existing DC object which contains a valid DLPE cache and simply restart the "retry to connect" timer. This way the DLPE cache is maintained throughout the reconnect to DC process.
1717
* While testing Boot from SAN (BFS) and using a Host NQN during boot that is different from the Host NQN used after boot (i.e. the Host NQN defined in `/etc/nvme/hostnqn`), we found that nvme-stas and libnvme are reusing existing connections even if the Host NQN doesn't match. nvme-stas will now take a connection's Host NQN into consideration before deciding if a connection can be reused. A similar fix will be provided in libnvme as well.
18+
* `Udev._cid_matches_tid()` - When checking `subsysnqn`, take well-known NQN (`nqn.2014-08.org.nvmexpress.discovery`) into account. Per TP8013, Discovery Controllers may use a unique NQN instead of the well-known NQN. This can cause a discrepancy between the candidate connection DC and existing connections and cause a matching existing connection to fail to match the candidate connection.
1819

1920
## Changes with release 2.2.3
2021

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
project(
1010
'nvme-stas',
1111
meson_version: '>= 0.53.0',
12-
version: '2.3-rc4',
12+
version: '2.3-rc5',
1313
license: 'Apache-2.0',
1414
default_options: [
1515
'buildtype=release',

staslib/udev.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,14 @@ def _cid_matches_tid(tid, cid, ifaces): # pylint: disable=too-many-return-stat
251251
6.1.
252252
'''
253253
# 'transport', 'traddr', 'trsvcid', 'subsysnqn', and 'host-nqn' must exactly match.
254-
if (
255-
cid['transport'] != tid.transport
256-
or cid['trsvcid'] != tid.trsvcid
257-
or cid['subsysnqn'] != tid.subsysnqn
258-
or cid['host-nqn'] != tid.host_nqn
259-
):
254+
if tid.transport != cid['transport'] or tid.trsvcid != cid['trsvcid'] or tid.host_nqn != cid['host-nqn']:
255+
return False
256+
257+
# With TP8013, Discovery Controllers may respond with a unique NQN even
258+
# when a connection request is made with the well-known NQN. Therefore,
259+
# the subsysnqn is not reliable when the candidate requests the well-
260+
# known NQN.
261+
if tid.subsysnqn not in (defs.WELL_KNOWN_DISC_NQN, cid['subsysnqn']):
260262
return False
261263

262264
if tid.transport in ('tcp', 'rdma'):

0 commit comments

Comments
 (0)