File bug-1145231_apply-obtain_device_list_from_udev-to-all-libudev-us.patch of Package device-mapper.17388

From 57cde6063f3073e73542c5f7f59d0269ad9b703b Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Tue, 5 Feb 2019 10:15:40 -0600
Subject: [PATCH] apply obtain_device_list_from_udev to all libudev usage

udev_dev_is_md_component and udev_dev_is_mpath_component
are not used for obtaining the device list, but they still
use libudev for device info.  When there are problems with
udev, these functions can get stuck. So, use the existing
obtain_device_list_from_udev config setting to also control
whether these "is component" functions are used, which gives
us a way to avoid using libudev entirely when it's causing
problems.
---
 lib/device/dev-type.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index 33ebb73b2c..e909c0f067 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -1063,6 +1063,9 @@ int udev_dev_is_mpath_component(struct device *dev)
 	const char *value;
 	int ret = 0;
 
+	if (!obtain_device_list_from_udev())
+		return 0;
+
 	if (!(udev_device = _udev_get_dev(dev)))
 		return 0;
 
@@ -1092,6 +1095,9 @@ int udev_dev_is_md_component(struct device *dev)
 	const char *value;
 	int ret = 0;
 
+	if (!obtain_device_list_from_udev())
+		return 0;
+
 	if (!(udev_device = _udev_get_dev(dev)))
 		return 0;
 
-- 
2.21.0

openSUSE Build Service is sponsored by