summaryrefslogtreecommitdiff
path: root/lib/cache
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/cache
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/cache')
-rw-r--r--lib/cache/lvmcache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index e15b6ce85..f5df5e10c 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -692,7 +692,7 @@ next:
*/
info = lvmcache_info_from_pvid(pvid, NULL, 0);
- if (info && dev_is_md_component(info->dev, NULL, 1)) {
+ if (info && dev_is_md_component(cmd, info->dev, NULL, 1)) {
/* does not go in del_cache_devs which become unused_duplicates */
log_debug_cache("PV %s drop MD component from scan selection %s", pvid, dev_name(info->dev));
lvmcache_del(info);
@@ -700,7 +700,7 @@ next:
}
dm_list_iterate_items_safe(devl, devl_safe, &altdevs) {
- if (dev_is_md_component(devl->dev, NULL, 1)) {
+ if (dev_is_md_component(cmd, devl->dev, NULL, 1)) {
log_debug_cache("PV %s drop MD component from scan duplicates %s", pvid, dev_name(devl->dev));
dm_list_del(&devl->list);
}
@@ -1204,7 +1204,7 @@ void lvmcache_extra_md_component_checks(struct cmd_context *cmd)
(unsigned long long)pvsize, (unsigned long long)devsize,
device_hint ?: "none", dev_name(dev));
- if (dev_is_md_component(dev, NULL, 1)) {
+ if (dev_is_md_component(cmd, dev, NULL, 1)) {
log_debug("dropping PV from md component %s", dev_name(dev));
dev->flags &= ~DEV_SCAN_FOUND_LABEL;
/* lvmcache_del will also delete vginfo if info was last one */