diff --git a/0001-rdma-ndd-fix-udev-racy-issue-for-system-with-multipl.patch b/0001-rdma-ndd-fix-udev-racy-issue-for-system-with-multipl.patch new file mode 100644 index 0000000000000000000000000000000000000000..473a89240947afa71e42bfc08f6fe6e685d90ccb --- /dev/null +++ b/0001-rdma-ndd-fix-udev-racy-issue-for-system-with-multipl.patch @@ -0,0 +1,56 @@ +From 12642839a58a1e6240b5c3376ee87f783c475f3d Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Tue, 16 Mar 2021 21:12:09 -0400 +Subject: [PATCH] rdma-ndd: fix udev racy issue for system with multiple + InfiniBand HCAs + +[ Upstream commit 649d6b8c58fcc8afa809cf874b65b03a5607143c ] + +After read the system hostname, the function `monitor` calls function +`set_rdma_node_desc` to initialize the node description for HCAs had +been detected by kernel. + +For system with multiple InfiniBand HCAs, only the first HCA is +guaranteed to be detected by kernel at this point. The systemd udev +"add" event for the rest HCAs may be emitted before rdma-ndd listen +udev event via function `get_udev_fd`. That means the "add" event +will never be sent to rdma-ndd service, as rdma-ndd not ready for udev +even yet. So, the node description for those HCAs may not be updated +by rdma-ndd during system boot. + +With this patch, rdma-ndd will initialize the node description after +it listen to udev. InfiniBand HCAs detected after the initialization +will be handled by udev even. + +Reported-by: Georg Sauthoff +Tested-by: Georg Sauthoff +Signed-off-by: Honggang Li +Signed-off-by: Nicolas Morey-Chaisemartin +--- + rdma-ndd/rdma-ndd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rdma-ndd/rdma-ndd.c b/rdma-ndd/rdma-ndd.c +index 418d1de9456b..03d0b79dd7f8 100644 +--- a/rdma-ndd/rdma-ndd.c ++++ b/rdma-ndd/rdma-ndd.c +@@ -254,7 +254,6 @@ static void monitor(bool systemd) + } + + read_hostname(hn_fd, hostname, sizeof(hostname)); +- set_rdma_node_desc((const char *)hostname, 1); + + fds[0].fd = hn_fd; + fds[0].events = 0; +@@ -269,6 +268,8 @@ static void monitor(bool systemd) + if (systemd) + sd_notify(0, "READY=1"); + ++ set_rdma_node_desc((const char *)hostname, 1); ++ + while (1) { + if (poll(fds, numfds, -1) <= 0) { + syslog(LOG_ERR, "Poll %s failed; exiting\n", SYS_HOSTNAME); +-- +2.25.4 + diff --git a/rdma-core.spec b/rdma-core.spec index c16d59eafc6b46e07c35ee78870a9890d3a86a5c..046752fcd5d943d77bdbfd262e7290b4a0e030bc 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core Version: 22.4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: RDMA core userspace libraries and daemons %ifnarch %{arm} @@ -39,6 +39,7 @@ Patch107: 0001-bnxt_re-lib-Add-remaining-pci-ids-for-gen-P5-devices.patch Patch108: 0002-bnxt_re-lib-Recognize-additional-5750x-device-ID-s.patch Patch109: 0001-libibverbs-Fix-ABI_placeholder1-and-ABI_placeholder2.patch +Patch110: 0001-rdma-ndd-fix-udev-racy-issue-for-system-with-multipl.patch # Do not build static libs by default. %define with_static %{?_with_static: 1} %{?!_with_static: 0} @@ -304,6 +305,7 @@ discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand. %patch107 -p1 %patch108 -p1 %patch109 -p1 +%patch110 -p1 %build @@ -573,6 +575,10 @@ rm -rf %{buildroot}/%{_initrddir}/ %doc %{_docdir}/%{name}-%{version}/ibsrpdm.md %changelog +* Mon Apr 12 2021 Honggang Li - 22.4-6 +- rdma-ndd: fix udev racy issue for system with multiple InfiniBand HCAs +- Resolves: rhbz#1937699 + * Sat Jun 06 2020 Honggang Li - 22.4-5 - libibverbs: Fix ABI_placeholder1 and ABI_placeholder2 assignment - Resolves: rhbz#1843221