summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* test rhel5 sysfsdev-dct-test-rhel5David Teigland2021-11-081-0/+2
|
* vgchange -aay: improve unexpected command variationsDavid Teigland2021-11-086-41/+178
| | | | | | | | | | | | | | | | | | | | | | | | | For completeness and consistency, adjust the behavior for some variations of: vgchange -aay --autoactivation event [vgname] The current standard use is with a VG name arg, and the command is only called when all pvs_online files exist. This is the optimal case, in which only pvs_online devs are read. This remains the same. Clean up behaviors for some other unexpected uses of the command: . With no VG name arg, the command activates any VGs that are complete according to pvs_online. If no pvs_online files exist, it does nothing. . If a VG name is used but no PVs online files exist for the VG, or the PVs online files are incomplete, then consider there could be a problem with the pvs_online files, and fall back to a full label scan prior to attempting the activation.
* vgchange -aay: fall back to dev_cache_scan if optimization failsDavid Teigland2021-11-051-6/+37
| | | | | | | | | | Part of the optimization to avoid a full dev_cache_scan requires translating major:minor numbers to a device name. If this devno translation fails, then fall back to doing a full dev_cache_scan which is slower but certain to provide the info. This preserves the most important part of the label scanning optimization in the vgchange aay (avoiding dev_cache_scan is a relatively small part of the optimized activation compared to label scanning.)
* fix device name from devno for partitionsDavid Teigland2021-11-051-1/+2
| | | | | | sysfs files for partitions are different from whole devices and will require more work to translate to device names.
* vgchange -aay: optimize device list using pvs_online filesDavid Teigland2021-11-0515-135/+357
| | | | | | | | | | | | | | | | | | | | | | | Port another optimization from pvscan -aay to vgchange -aay: "pvscan: only add device args to dev cache" This optimization avoids doing a full dev_cache_scan, and instead populates dev-cache with only the devices in the VG being activated. This involves shifting the use of pvs_online files from the hints interface up to the higher level label_scan interface. This specialized label_scan is structured around creating a list of devices from the pvs_online files. Previously, a list of all devices was created first, and then reduced based on the pvs_online files. The initial step of listing all devices was slow when thousands of devices are present on the system. This optimization extends the previous optimization that used pvs_online files to limit the devices that were actually scanned (i.e. reading to identify the device): "vgchange -aay: optimize device scan using pvs_online files"
* lvm2-pvscan: include --autoactivation eventDavid Teigland2021-11-041-1/+1
| | | | | in the pvscan --cache -aay command so that the use of the command for event activation is explicit.
* move code from pvscan.c to online.cDavid Teigland2021-11-049-340/+384
| | | | | related to managing files in /run/lvm/pvs_online and /run/lvm/vgs_online
* vgchange -aay: optimize device scan using pvs_online filesDavid Teigland2021-11-048-11/+199
| | | | | | | | | | | | | | | | | | | Port the old pvscan -aay scanning optimization to vgchange -aay. The optimization uses pvs_online files created by pvscan --cache to derive a list of devices to use when activating a VG. This allows autoactivation of a VG to avoid scanning all devices, and only scan the devices used by the VG itself. The optimization is applied internally using the device hints interface. The new option "--autoactivation event" is given to pvscan and vgchange commands that are called by event activation. This informs the command that it is being used for event activation, so that it can apply checks and optimizations that are specific to event activation. Those include: - skipping the command if lvm.conf event_activation=0 - checking that a VG is complete before activating it - using pvs_online files to limit device scanning
* rename pvscan_cache_single to expect_missing_vg_device in cmdDavid Teigland2021-11-044-7/+6
|
* add hints interface to the pvs_online file informationDavid Teigland2021-11-046-6/+137
| | | | | | | | | | | | | | | The information in /run/lvm/pvs_online/<pvid> files can be used to build a list of devices for a given VG. The pvscan -aay command has long used this information to activate a VG while scanning only devices in that VG, which is an important optimization for autoactivation. This patch implements the same thing through the existing device hints interface, so that the optimization can be applied elsewhere. A future patch will take advantage of this optimization in vgchange -aay, which is now used in place of pvscan -aay for event activation.
* lvmdevices: increase open file limitDavid Teigland2021-11-033-2/+7
|
* filter-sysfs: skip when device id is setDavid Teigland2021-11-022-288/+32
| | | | | | | | | | | | | | | | | | | | | When a device id is set for a device, using an idtype other than devname, it means that sysfs has been used with the device to match the device id. So, checking for a sysfs entry for the device in filter-sysfs is redundant. For any other cases not covered by this (e.g. devname ids), have filter-sysfs simply stat /sys/dev/block/major:minor to test if the device exists in sysfs. The extensive processing done by filter-sysfs init is removed. It was taking an immense amount of time with many devices, e.g. . 1024 PVs in 520 VGs . 520 concurrent vgchange -ay <vgname> commands . vgchange scans only PVs in the named VG (based on pvs_online files from a pending patch) A large number of the vgchange commands were taking over 1 min, and nearly half of that time was used by filter-sysfs init. With this patch, the vgchange commands take about half the time.
* hints: remove the cmd hints listDavid Teigland2021-11-014-10/+2
| | | | | which is no longer used after commit "toollib: remove all devices list from process_each_pv"
* 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.