Skip to contentSkip to conversation

libmultipath: avoid buffer size warning with systemd 240+

PATCH In review [email protected] 2 participants 2 messages Aug 12, 2021 – Aug 30, 2021 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libmultipath: avoid buffer size warning with systemd 240+

From: Martin Wilck <[email protected]>

Since systemd commit e39b4d2 ("libudev: re-implement udev-monitor by sd_device_monitor"), udev_monitor_set_receive_buffer_size() returns 1 on success. Fix the test for the return value to avoid a misleading "failed to increase buffer size" warning.

---
 libmultipath/uevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/uevent.c +1 -1
index d3061bf..4265904 100644
@@ -569,7 +569,7 @@ 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))
+	if (udev_monitor_set_receive_buffer_size(monitor, 128 * 1024 * 1024) < 0)
 		condlog(2, "failed to increase buffer size");
 #endif
 	fd = udev_monitor_get_fd(monitor);
Signature · 7 lines
2.32.0


--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Thu, Aug 12, 2021 at 12:45:15PM +0200, [email protected] wrote:

From: Martin Wilck <[email protected]>

Since systemd commit e39b4d2 ("libudev: re-implement udev-monitor by sd_device_monitor"), udev_monitor_set_receive_buffer_size() returns 1 on success. Fix the test for the return value to avoid a misleading "failed to increase buffer size" warning.

Quoted 19 lines
---
 libmultipath/uevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/uevent.c +1 -1
index d3061bf..4265904 100644
@@ -569,7 +569,7 @@ 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))
+	if (udev_monitor_set_receive_buffer_size(monitor, 128 * 1024 * 1024) < 0)
 		condlog(2, "failed to increase buffer size");
 #endif
 	fd = udev_monitor_get_fd(monitor);
Signature · 1 line
2.32.0

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel