Skip to content

Commit 8652b35

Browse files
howligaw
authored andcommitted
udev: don't spread variables through all nodes
NVME_HOST_IFACE=none is being set to every existing node device but this shouldn't be done, we don't want this in /dev/peanutbutter. To quick check this error just launch "udevadm trigger" and then "udevadm info" any dev node you want, the variable will be set for all the nodes. The easier way to understand this /dev/zero, /dev/null, /dev/random has nothing to do with this variable. To solve this a condition to only apply for the nvme subsystem is added as is the only subsystem later check for this variable to be present. While at it remove all the action change conditions that are always true given the if it's any other kind of action a goto end in the beginning. Signed-off-by: David Santamaría Rogado <[email protected]>
1 parent 046b9e2 commit 8652b35

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

nvmf-autoconnect/udev-rules/70-nvmf-autoconnect.rules.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
ACTION!="change", GOTO="autoconnect_end"
88

99
# For backwards compatibility. Make sure HOST_IFACE is not an empty string.
10-
ENV{NVME_HOST_IFACE}=="", ENV{NVME_HOST_IFACE}="none"
10+
SUBSYSTEM=="nvme", ENV{NVME_HOST_IFACE}=="", ENV{NVME_HOST_IFACE}="none"
1111

1212
# Events from persistent discovery controllers or nvme-fc transport events
1313
# NVME_AEN:
1414
# type 0x2 (NOTICE) info 0xf0 (DISCOVERY_LOG_CHANGE) log-page-id 0x70 (DISCOVERY_LOG_PAGE)
15-
ACTION=="change", SUBSYSTEM=="nvme", ENV{NVME_AEN}=="0x70f002", \
15+
SUBSYSTEM=="nvme", ENV{NVME_AEN}=="0x70f002", \
1616
ENV{NVME_TRTYPE}=="*", ENV{NVME_TRADDR}=="*", \
1717
ENV{NVME_TRSVCID}=="*", ENV{NVME_HOST_TRADDR}=="*", ENV{NVME_HOST_IFACE}=="*", \
1818
RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device\x3d$kernel\t--transport\x3d$env{NVME_TRTYPE}\t--traddr\x3d$env{NVME_TRADDR}\t--trsvcid\x3d$env{NVME_TRSVCID}\t--host-traddr\x3d$env{NVME_HOST_TRADDR}\t--host-iface\x3d$env{NVME_HOST_IFACE}.service"
1919

2020
# nvme-fc transport generated events (old-style for compatibility)
21-
ACTION=="change", SUBSYSTEM=="fc", ENV{FC_EVENT}=="nvmediscovery", \
21+
SUBSYSTEM=="fc", ENV{FC_EVENT}=="nvmediscovery", \
2222
ENV{NVMEFC_HOST_TRADDR}=="*", ENV{NVMEFC_TRADDR}=="*", \
2323
RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device\x3dnone\t--transport\x3dfc\t--traddr\x3d$env{NVMEFC_TRADDR}\t--trsvcid\x3dnone\t--host-traddr\x3d$env{NVMEFC_HOST_TRADDR}.service"
2424

2525
# A discovery controller just (re)connected, re-read the discovery log change to
2626
# check if there were any changes since it was last connected.
27-
ACTION=="change", SUBSYSTEM=="nvme", ENV{NVME_EVENT}=="rediscover", ATTR{cntrltype}=="discovery", \
27+
SUBSYSTEM=="nvme", ENV{NVME_EVENT}=="rediscover", ATTR{cntrltype}=="discovery", \
2828
ENV{NVME_TRTYPE}=="*", ENV{NVME_TRADDR}=="*", \
2929
ENV{NVME_TRSVCID}=="*", ENV{NVME_HOST_TRADDR}=="*", ENV{NVME_HOST_IFACE}=="*", \
3030
RUN+="@SYSTEMCTL@ --no-block restart nvmf-connect@--device\x3d$kernel\t--transport\x3d$env{NVME_TRTYPE}\t--traddr\x3d$env{NVME_TRADDR}\t--trsvcid\x3d$env{NVME_TRSVCID}\t--host-traddr\x3d$env{NVME_HOST_TRADDR}\t--host-iface\x3d$env{NVME_HOST_IFACE}.service"

0 commit comments

Comments
 (0)