From: Joe Slater <[email protected]>

Since systemd v246.5[1], udev_monitor_set_receive_buffer_size() will
return 0 or 1 if successful. We only need to check a negative value for
the failure.

[1] 
https://github.com/systemd/systemd-stable/commit/4dcae666889ae9469e4406c0bcaffadbc01c4f66
    
https://github.com/systemd/systemd-stable/commit/fe9b92e566f837665cc06c82374e4e42f9295c99
    
https://github.com/systemd/systemd-stable/commit/5dd4cc4b10daea5d2ba969425ba02d2098dd06a4

Signed-off-by: Joe Slater <[email protected]>
Signed-off-by: Yi Zhao <[email protected]>
---
 ...ent.c-fix-error-handling-for-udev_mo.patch | 39 +++++++++++++++++++
 .../multipath-tools/multipath-tools_0.8.4.bb  |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 
meta-oe/recipes-support/multipath-tools/files/0001-libmultipath-uevent.c-fix-error-handling-for-udev_mo.patch

diff --git 
a/meta-oe/recipes-support/multipath-tools/files/0001-libmultipath-uevent.c-fix-error-handling-for-udev_mo.patch
 
b/meta-oe/recipes-support/multipath-tools/files/0001-libmultipath-uevent.c-fix-error-handling-for-udev_mo.patch
new file mode 100644
index 000000000..d261b13d9
--- /dev/null
+++ 
b/meta-oe/recipes-support/multipath-tools/files/0001-libmultipath-uevent.c-fix-error-handling-for-udev_mo.patch
@@ -0,0 +1,39 @@
+From 8579d8a35886f91974e0ac4dbdf2edb7dac06d52 Mon Sep 17 00:00:00 2001
+From: Joe Slater <[email protected]>
+Date: Fri, 18 Dec 2020 11:17:50 +0800
+Subject: [PATCH] libmultipath/uevent.c: fix error handling for
+ udev_monitor_set_receive_buffer_size
+
+Since systemd v246.5[1], udev_monitor_set_receive_buffer_size() will
+return 0 or 1 if successful. We only need to check a negative value for
+the failure.
+
+[1] 
https://github.com/systemd/systemd-stable/commit/4dcae666889ae9469e4406c0bcaffadbc01c4f66
+    
https://github.com/systemd/systemd-stable/commit/fe9b92e566f837665cc06c82374e4e42f9295c99
+    
https://github.com/systemd/systemd-stable/commit/5dd4cc4b10daea5d2ba969425ba02d2098dd06a4
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <[email protected]>
+Signed-off-by: Yi Zhao <[email protected]>
+---
+ libmultipath/uevent.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c
+index d38e8a7f..4b298052 100644
+--- a/libmultipath/uevent.c
++++ b/libmultipath/uevent.c
+@@ -810,7 +810,8 @@ int uevent_listen(struct udev *udev)
+       }
+       pthread_cleanup_push(monitor_cleanup, monitor);
+ #ifdef LIBUDEV_API_RECVBUF
+-      if (udev_monitor_set_receive_buffer_size(monitor, 128 * 1024 * 1024))
++      err = udev_monitor_set_receive_buffer_size(monitor, 128 * 1024 * 1024);
++      if (err < 0)
+               condlog(2, "failed to increase buffer size");
+ #endif
+       fd = udev_monitor_get_fd(monitor);
+-- 
+2.17.1
+
diff --git a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb 
b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb
index 331c0cd01..186f78b8f 100644
--- a/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb
+++ b/meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb
@@ -47,6 +47,7 @@ SRC_URI = 
"git://git.opensvc.com/multipath-tools/.git;protocol=http \
            file://0001-fix-bug-of-do_compile-and-do_install.patch \
            file://0001-add-explicit-dependency-on-libraries.patch \
            file://0001-fix-boolean-value-with-json-c-0.14.patch \
+           
file://0001-libmultipath-uevent.c-fix-error-handling-for-udev_mo.patch \
            "
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#88317): 
https://lists.openembedded.org/g/openembedded-devel/message/88317
Mute This Topic: https://lists.openembedded.org/mt/79055870/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to