summaryrefslogtreecommitdiff
path: root/lib/config
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-06-08 17:12:09 -0500
committerDavid Teigland <teigland@redhat.com>2021-07-13 11:11:23 -0500
commit90485650931d3fc04d00c92a729050c8743969e5 (patch)
treee7b17771fba2aeba3fa9415a68524022ca30d60d /lib/config
parentdb22a389cfb12eef77dfc2e1ce124ac83ed6c5a2 (diff)
downloadlvm2-90485650931d3fc04d00c92a729050c8743969e5.tar.gz
devices: rework libudev usage
related to config settings: obtain_device_info_from_udev (controls if lvm gets a list of devices from readdir /dev or from libudev) external_device_info_source (controls if lvm asks libudev for device information) . Make the obtain_device_list_from_udev setting affect only the choice of readdir /dev vs libudev. The setting no longer controls if udev is used for device type checks. . Change obtain_device_list_from_udev default to 0. This helps avoid boot timeouts due to slow libudev queries, avoids reported failures from udev_enumerate_scan_devices, and avoids delays from "device not initialized in udev database" errors. Even without errors, for a system booting with 1024 PVs, lvm2-pvscan times improve from about 100 sec to 15 sec, and the pvscan command from about 64 sec to about 4 sec. . For external_device_info_source="none", remove all libudev device info queries, and use only lvm native device info. . For external_device_info_source="udev", first check lvm native device info, then check libudev info. . Remove sleep/retry loop when attempting libudev queries for device info. udev info will simply be skipped if it's not immediately available. . Only set up a libdev connection if it will be used by obtain_device_list_from_udev/external_device_info_source. . For native multipath component detection, use /etc/multipath/wwids. If a device has a wwid matching an entry in the wwids file, then it's considered a multipath component. This is necessary to natively detect multipath components when the mpath device is not set up.
Diffstat (limited to 'lib/config')
-rw-r--r--lib/config/config_settings.h24
-rw-r--r--lib/config/defaults.h4
2 files changed, 11 insertions, 17 deletions
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index d66a9a3a7..fa87bea23 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -238,22 +238,10 @@ cfg(devices_obtain_device_list_from_udev_CFG, "obtain_device_list_from_udev", de
"udev support for this setting to apply.\n")
cfg(devices_external_device_info_source_CFG, "external_device_info_source", devices_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_EXTERNAL_DEVICE_INFO_SOURCE, vsn(2, 2, 116), NULL, 0, NULL,
- "Select an external device information source.\n"
- "Some information may already be available in the system and LVM can\n"
- "use this information to determine the exact type or use of devices it\n"
- "processes. Using an existing external device information source can\n"
- "speed up device processing as LVM does not need to run its own native\n"
- "routines to acquire this information. For example, this information\n"
- "is used to drive LVM filtering like MD component detection, multipath\n"
- "component detection, partition detection and others.\n"
- "#\n"
- "Accepted values:\n"
- " none\n"
- " No external device information source is used.\n"
- " udev\n"
- " Reuse existing udev database records. Applicable only if LVM is\n"
- " compiled with udev support.\n"
- "#\n")
+ "Enable device information from udev.\n"
+ "If set to \"udev\", lvm will supplement its own native device information\n"
+ "with information from libudev. This can potentially improve the detection\n"
+ "of MD component devices and multipath component devices.\n")
cfg(devices_hints_CFG, "hints", devices_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_HINTS, vsn(2, 3, 2), NULL, 0, NULL,
"Use a local file to remember which devices have PVs on them.\n"
@@ -393,6 +381,10 @@ cfg(devices_scan_lvs_CFG, "scan_lvs", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, DEF
cfg(devices_multipath_component_detection_CFG, "multipath_component_detection", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_MULTIPATH_COMPONENT_DETECTION, vsn(2, 2, 89), NULL, 0, NULL,
"Ignore devices that are components of DM multipath devices.\n")
+cfg(devices_multipath_wwids_file_CFG, "multipath_wwids_file", devices_CFG_SECTION, CFG_DEFAULT_COMMENTED | CFG_ALLOW_EMPTY, CFG_TYPE_STRING, DEFAULT_WWIDS_FILE, vsn(2, 3, 13), NULL, 0, NULL,
+ "The path to the multipath wwids file used for multipath component detection.\n"
+ "Set this to an empty string to disable the use of the multipath wwids file.\n")
+
cfg(devices_md_component_detection_CFG, "md_component_detection", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_MD_COMPONENT_DETECTION, vsn(1, 0, 18), NULL, 0, NULL,
"Enable detection and exclusion of MD component devices.\n"
"An MD component device is a block device that MD uses as part\n"
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index d5e5b3b1a..66eece53a 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -42,7 +42,7 @@
#define DEFAULT_DEV_DIR "/dev"
#define DEFAULT_PROC_DIR "/proc"
#define DEFAULT_SYSTEM_ID_SOURCE "none"
-#define DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV 1
+#define DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV 0
#define DEFAULT_EXTERNAL_DEVICE_INFO_SOURCE "none"
#define DEFAULT_SYSFS_SCAN 1
#define DEFAULT_MD_COMPONENT_DETECTION 1
@@ -327,4 +327,6 @@
#define DEFAULT_SEARCH_FOR_DEVNAMES "auto"
+#define DEFAULT_WWIDS_FILE "/etc/multipath/wwids"
+
#endif /* _LVM_DEFAULTS_H */