summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* add activation servicesdev-dct-activation-switch-11David Teigland2021-11-0125-74/+807
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New systemd services for startup: lvm-devices-wait.service Used in place of systemd-udev-settle, this service waits for udev+pvscan to process PVs listed in system.devices. It runs the command "lvmdevices --wait pvsonline". This only waits for PVs that can be matched to a device in sysfs, so it only waits for devices attached to the system. It waits specifically for the /run/lvm/pvs_online/<pvid> files to be created by pvscan. It quits waiting after a configurable number of seconds. This service gives the first activation service a chance to activate VGs from PVs that are available immediately at startup. If this service quits waiting before all the expected pvid files appear, then the VG associated with those PVs will most likely be activated by the -last service rather than the initial -main service. If those PVs are even slower to complete processing than the -last service, then the VG will be activated by event activation whenever they are finally complete. lvm-activate-vgs-main.service Calls "vgchange -aay", after lvm-devices-wait, to activate complete VGs. It only considers PVs that have been processed by udev+pvscan and have pvs_online files. This is expected to activate VGs from basic devices (not virtual device types) that are present at startup. lvm-activate-vgs-last.service Calls "vgchange -aay", after multipathd has started, to activate VGs that became available after virtual device services were started, e.g. VGs on multipath devices. Like -main, it only looks at PVs that have been processed by pvscan. This vgchange in the -last service enables event activation by creating the /run/lvm/event-activation-on file. Event activation will activate any further VGs that appear on the system (or complete udev processing) after the -last service. In the case of event activation, the udev rule will run vgchange -aay <vgname> via a transient service lvm-activate-<vgname>.service. This vgchange only scans PVs in the VG being activated, also based on the pvs_online files from pvscan. When there are many VGs that need activation during system startup, the two fixed services can activate them all much faster than activating each VG individually via events. lvm.conf auto_activation_settings can be used to configure the behavior (default ["service_and_event", "pvscan_hints"]). "service_and_event" - the behavior described above, where activation services are used first, and event activation is used afterward. "service_only" - only lvm-activate-vgs-* are used, and no event-based activation occurs after the services finish. (Equivalent to setting lvm.conf event_activation=0.) "event_only" - the lvm-activate-vgs* services are skipped, and all VGs are activated individually with event-based activation. "pvscan_hints" - the vgchange autoactivation commands use pvs_online files created by pvscan. This optimization limits the devices scanned by the vgchange command to only PVs that have been processed by pvscan.
* hints: new pvs_online typeDavid Teigland2021-10-295-5/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new form of hints to use in autoactivation commands during startup to reduce device scanning. Using these hints, vgchange will read only the devices for the VG it is activating. Standard hints allow a command with a named VG arg to scan only the PVs in the named VG, rather than scanning all available PVs. Standard hints are useful with a stable set of system devices. When new devices are arriving, as occurs during system startup, the hints are repeatedly invalidated, which makes standard hints unhelpful while devices are regularly appearing. This is the situation in which vgchange -aay is used, so standard hints are not generally helpful for autoactivation. In the context of system startup, pvscan --cache is keeping track of available PVs using the pvs_online files, similar to what the hints file does for a running system. Given this, a new hint mode, hints = "pvs_online", is added which derives an equivalent to standard hints, based on pvs_online files that are being created by udev-run pvscans. This hint mode is useful while devices are appearing, e.g. during system startup, and vgchange -aay can benefit from it. pvscan --cache -aay autoactivation already has a similar optimization (the "quick" activation case) that is based on the pvs_online file, but it is not implemented as a form of hints. This new form of hints is mainly useful in the context of event based autoactivation, during which standard hints are not useful. Once the system is in a steady state after startup (devices are not regularly appearing), the standard hints are most useful. The pvs_online hint method could be used on a running system, but would be no better than standard hints, and may be inferior because pvs_online files are not rigidly updated after system startup.
* lvmdevices: increase open file limitDavid Teigland2021-10-293-2/+7
|
* vgimportdevices: skip lvmlockd lockingDavid Teigland2021-10-251-0/+11
| | | | | | | | Help bootstrapping existing shared vgs into the devices file. Reading the vg in vgimportdevices would require locking to be started, but vgchange lockstart won't see the vg if it's not in the devices file. The lvmlockd locks are not protecting vg modifications so skipping them here won't be a problem.
* The path is known anyway and should be the bullet proof option.Christian Hesse2021-10-211-1/+1
| | | | Signed-off-by: Christian Hesse <mail@eworm.de>
* pvscan: fix messages from coverity changesDavid Teigland2021-10-201-2/+2
|
* post-releaseMarian Csontos2021-10-204-2/+8
|
* pre-releasev2_03_14Marian Csontos2021-10-204-6/+6
|
* WHATS_NEW: updateMarian Csontos2021-10-201-2/+2
|
* pvscan: only add device args to dev cacheDavid Teigland2021-10-196-52/+246
| | | | | Optimize the common pvscan --cache command by only adding the necessary devs to dev-cache.
* dev-cache: enhance dir scan also for non-udev buildZdenek Kabelac2021-10-181-1/+9
|
* dev-cache: better detection of filesystemZdenek Kabelac2021-10-181-9/+13
| | | | | It appear on some systems the first found dev might not be actually for the filesytem - so use a better way through _cache.st_dev.
* configure: updateZdenek Kabelac2021-10-182-98/+21
|
* configure.ac: remove unused partZdenek Kabelac2021-10-181-23/+6
| | | | | | | As we are not using 'enable-compat' for anything, remove this section. Also remove duplicated check for blkid. Move setting of some AC_ARG_ENABLE defaults into the macro so it's always defined.
* cleanup: use const char bufferZdenek Kabelac2021-10-181-1/+1
|
* dev-cache: skip different filesystems on dir scanZdenek Kabelac2021-10-182-0/+10
| | | | | | | | When scanning configured /dev dir, avoid entring directories with different filesystem. This minimizes risk we will block on i.e. entring directory with mount point.
* cov: check device_ids_write return codeZdenek Kabelac2021-10-151-2/+3
| | | | | At least 'stack' failure code path as the function device_id_update_vg_uuid() is void.
* cov: ensure id is always initializeZdenek Kabelac2021-10-151-2/+4
| | | | | Always resed sd_id128_t id and report warning in case sd_id128_get_machine_app_specific() does not exit with 0.
* cov: check pointer before dereferencingZdenek Kabelac2021-10-151-2/+2
| | | | Check pv2 is non-null before trying to deref its tags.
* cov: do not drop already known error stateZdenek Kabelac2021-10-151-3/+1
| | | | | Do not try to 'discover' another error state, when ENOMEM is already detected.
* cov: ignore close resultZdenek Kabelac2021-10-151-1/+1
|
* cov: validate subcommand existanceZdenek Kabelac2021-10-151-2/+2
| | | | | Before dereference of subcommand pointer, check it's not NULL as coverity believes there exists theoretical path for this...
* cov: avoid using NULL infoZdenek Kabelac2021-10-151-3/+7
| | | | Check lvmcache info exists before calling lvmcache_del_save_bad_mda().
* configure: fix use of withvalZdenek Kabelac2021-10-152-3/+2
| | | | Newly added option --with-default-use-devices-file needs to use withval.
* configure: updateZdenek Kabelac2021-10-151-98/+63
|
* configure.ac: enhance systemd testingZdenek Kabelac2021-10-151-26/+31
| | | | | | | | | | | Enhance logic for checking supported systemd version, while doing only a single check for systemd package. For version checking use PKG_CHECK_EXISTS() macro. Also use one pkg check for blkid. Avoid checking version for thin/cache_check when tools are not present on system.
* makefile: enhance run-unit-test targetZdenek Kabelac2021-10-151-1/+6
| | | | | Use TMPDIR for executing test and also ensure all libraries linked to the test are from builddir.
* unit-test: better check for O_DIRECTZdenek Kabelac2021-10-151-14/+22
| | | | | Instead of guessing tmpfs usage, just directly try if we could reopen file with O_DIRECT on the used filesystem.
* configure: bash var typoZdenek Kabelac2021-10-152-2/+2
|
* gcc: always initialize vg_completeZdenek Kabelac2021-10-151-1/+1
|
* gcc: archive reoder struct varsZdenek Kabelac2021-10-151-2/+1
| | | | | Easier for automatic struct initialization = { 0 } without warns from older gcc.
* configure: missed bracesZdenek Kabelac2021-10-152-6/+9
| | | | | Missed [] around AS_IF internals, Also missed to call pkg_config_init prior PKG_CHECK_MODULES().
* debug: reduce some debugging noiseZdenek Kabelac2021-10-146-7/+14
| | | | | | | | | | | Resolve event_activation configure option just once. Do not print debug_devs about 'bad' filtering, when actually filter already printed reason for skipping Do not trace more then once about backup being disabled. No debug when unlinked file does not exists in pvscan.
* make: generateZdenek Kabelac2021-10-142-8/+4
|
* log: also build without systemd_journal_supportZdenek Kabelac2021-10-141-0/+7
|
* configure: updatesZdenek Kabelac2021-10-144-163/+155
|
* configure.ac: improvementZdenek Kabelac2021-10-141-26/+58
| | | | | | | | | | | | | | | | | Handle automatically new setttings --disable-systemd-journal --disable-appmachineid Both setting will check presence of apropriate header files. In case they are present, build will try to automatically build with them (adding systemd dependency) User can anytime disabled them and drop systemd dependency. Also add --with-default-use-devices-file configure option to select automatically default value for this option. For this moment keep default upstream as 0
* makefiles: use proper install prefix for python dbusZdenek Kabelac2021-10-141-1/+1
| | | | | For non-standard prefix dir use correct installation path (so the python files are not installed into user's system).
* debug: better error messageZdenek Kabelac2021-10-141-1/+3
| | | | Add more details about size difference.
* archiving: update refactoringZdenek Kabelac2021-10-141-11/+11
| | | | | | Commit 5ea426e65628218569ede461312d80ba5d1c50fb handled case with file path without '/' incorrectly - there is valid use-case so switch 'log_error()' to valid code branch.
* fix segfault handling duplicate PVsDavid Teigland2021-10-144-5/+5
| | | | | cmd arg was missing when switching to use an alternative duplicate dev.
* fix lvmcache_add log_debug pvidDavid Teigland2021-10-131-4/+6
| | | | from previous cleanup
* toollib: remove all devices list from process_each_pvDavid Teigland2021-10-133-184/+71
| | | | | | | | | Reporting non-PVs / "all devices" is only done by pvs -a or pvdisplay -a, so avoid the work managing a list of all devices in process_each_pv. In the case when it's needed, use the results of label_scan which already determines which devs are not PVs.
* devices file: unmatching system id should just be warningDavid Teigland2021-10-131-5/+1
| | | | | there are likely more cases than not where the systemid does not match and the command should still run.
* fix syslog settingDavid Teigland2021-10-114-9/+11
| | | | | | | | Just setting lvm.conf level=N should not send messages to syslog (now the journal by default.) Sending messages to syslog should require setting lvm.conf log { syslog=1 level=N }.
* make: generateMarian Csontos2021-10-0746-88/+932
|
* lvmdbusd: Use ID_FS_TYPE UDev property in udevwatchVojtech Trefny2021-10-071-2/+2
| | | | | | | '.ID_FS_TYPE_NEW' is a custom property added by an LVM UDev rule which is now being removed and 'ID_FS_TYPE' has the same value. Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
* configure: updateMarian Csontos2021-10-072-0/+115
|
* new udev autoactivationDavid Teigland2021-10-075-4/+492
| | | | | | | | | | | | | | new udev rule 69-dm-lvm.rules replaces 69-dm-lvm-meta.rules and lvm2-pvscan.service udev rule calls pvscan directly on the added device pvscan output indicates if a complete VG can be activated udev env var LVM_VG_NAME_COMPLETE is used to pass complete VG name from pvscan to the udev rule udev rule uses systemd-run to run vgchange -aay <vgname>
* logging: to the systemd journalDavid Teigland2021-10-079-1/+159
| | | | | | | | | | | | | Configure via lvm.conf log/journal or command line --journal. Possible values: "command" records command information. "output" records default command output. "debug" records full command debugging. Multiple values can be set in lvm.conf as an array. One value can be set in --journal which is added to values set in lvm.conf