]> sourceware.org Git - lvm2.git/log
lvm2.git
3 years agolvm2-pvscan: include --autoactivation event
David Teigland [Thu, 4 Nov 2021 19:14:37 +0000 (14:14 -0500)]
lvm2-pvscan: include --autoactivation event

in the pvscan --cache -aay command so that the use
of the command for event activation is explicit.

3 years agomove code from pvscan.c to online.c
David Teigland [Wed, 3 Nov 2021 21:02:38 +0000 (16:02 -0500)]
move code from pvscan.c to online.c

related to managing files in /run/lvm/pvs_online
and /run/lvm/vgs_online

3 years agovgchange -aay: optimize device scan using pvs_online files
David Teigland [Wed, 3 Nov 2021 17:03:29 +0000 (12:03 -0500)]
vgchange -aay: optimize device scan using pvs_online files

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

3 years agorename pvscan_cache_single to expect_missing_vg_device in cmd
David Teigland [Wed, 3 Nov 2021 14:50:11 +0000 (09:50 -0500)]
rename pvscan_cache_single to expect_missing_vg_device in cmd

3 years agoadd hints interface to the pvs_online file information
David Teigland [Thu, 15 Jul 2021 21:33:50 +0000 (16:33 -0500)]
add hints interface to the pvs_online file information

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.

3 years agolvmdevices: increase open file limit
David Teigland [Fri, 29 Oct 2021 19:49:36 +0000 (14:49 -0500)]
lvmdevices: increase open file limit

3 years agofilter-sysfs: skip when device id is set
David Teigland [Tue, 2 Nov 2021 20:42:26 +0000 (15:42 -0500)]
filter-sysfs: skip when device id is set

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.

3 years agohints: remove the cmd hints list
David Teigland [Mon, 1 Nov 2021 21:01:09 +0000 (16:01 -0500)]
hints: remove the cmd hints list

which is no longer used after commit
"toollib: remove all devices list from process_each_pv"

3 years agovgimportdevices: skip lvmlockd locking
David Teigland [Mon, 25 Oct 2021 17:11:17 +0000 (12:11 -0500)]
vgimportdevices: skip lvmlockd locking

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.

3 years agoThe path is known anyway and should be the bullet proof option.
Christian Hesse [Thu, 21 Oct 2021 21:33:23 +0000 (16:33 -0500)]
The path is known anyway and should be the bullet proof option.

Signed-off-by: Christian Hesse <mail@eworm.de>
3 years agopvscan: fix messages from coverity changes
David Teigland [Wed, 20 Oct 2021 21:12:41 +0000 (16:12 -0500)]
pvscan: fix messages from coverity changes

3 years agopost-release
Marian Csontos [Wed, 20 Oct 2021 09:13:28 +0000 (11:13 +0200)]
post-release

3 years agopre-release v2_03_14
Marian Csontos [Wed, 20 Oct 2021 09:11:41 +0000 (11:11 +0200)]
pre-release

3 years agoWHATS_NEW: update
Marian Csontos [Wed, 20 Oct 2021 09:08:36 +0000 (11:08 +0200)]
WHATS_NEW: update

3 years agopvscan: only add device args to dev cache
David Teigland [Mon, 18 Oct 2021 21:24:24 +0000 (16:24 -0500)]
pvscan: only add device args to dev cache

Optimize the common pvscan --cache command by only adding
the necessary devs to dev-cache.

3 years agodev-cache: enhance dir scan also for non-udev build
Zdenek Kabelac [Mon, 18 Oct 2021 19:50:56 +0000 (21:50 +0200)]
dev-cache: enhance dir scan also for non-udev build

3 years agodev-cache: better detection of filesystem
Zdenek Kabelac [Mon, 18 Oct 2021 19:08:19 +0000 (21:08 +0200)]
dev-cache: better detection of filesystem

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.

3 years agoconfigure: update
Zdenek Kabelac [Mon, 18 Oct 2021 17:13:58 +0000 (19:13 +0200)]
configure: update

3 years agoconfigure.ac: remove unused part
Zdenek Kabelac [Sat, 16 Oct 2021 20:08:50 +0000 (22:08 +0200)]
configure.ac: remove unused part

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.

3 years agocleanup: use const char buffer
Zdenek Kabelac [Sat, 16 Oct 2021 08:09:02 +0000 (10:09 +0200)]
cleanup: use const char buffer

3 years agodev-cache: skip different filesystems on dir scan
Zdenek Kabelac [Mon, 18 Oct 2021 17:04:44 +0000 (19:04 +0200)]
dev-cache: skip different filesystems on dir scan

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.

3 years agocov: check device_ids_write return code
Zdenek Kabelac [Fri, 15 Oct 2021 13:04:43 +0000 (15:04 +0200)]
cov: check device_ids_write return code

At least 'stack' failure code path as the
function device_id_update_vg_uuid() is void.

3 years agocov: ensure id is always initialize
Zdenek Kabelac [Fri, 15 Oct 2021 13:00:03 +0000 (15:00 +0200)]
cov: ensure id is always initialize

Always resed sd_id128_t id and report warning in case
sd_id128_get_machine_app_specific() does not exit with 0.

3 years agocov: check pointer before dereferencing
Zdenek Kabelac [Fri, 15 Oct 2021 12:48:48 +0000 (14:48 +0200)]
cov: check pointer before dereferencing

Check pv2 is non-null before trying to deref its tags.

3 years agocov: do not drop already known error state
Zdenek Kabelac [Fri, 15 Oct 2021 12:46:23 +0000 (14:46 +0200)]
cov: do not drop already known error state

Do not try to 'discover' another error state, when ENOMEM
is already detected.

3 years agocov: ignore close result
Zdenek Kabelac [Fri, 15 Oct 2021 12:42:34 +0000 (14:42 +0200)]
cov: ignore close result

3 years agocov: validate subcommand existance
Zdenek Kabelac [Fri, 15 Oct 2021 12:42:20 +0000 (14:42 +0200)]
cov: validate subcommand existance

Before dereference of subcommand pointer, check it's not NULL
as  coverity believes there exists theoretical path for this...

3 years agocov: avoid using NULL info
Zdenek Kabelac [Fri, 15 Oct 2021 12:42:10 +0000 (14:42 +0200)]
cov: avoid using NULL info

Check lvmcache info exists before calling lvmcache_del_save_bad_mda().

3 years agoconfigure: fix use of withval
Zdenek Kabelac [Fri, 15 Oct 2021 21:33:59 +0000 (23:33 +0200)]
configure: fix use of withval

Newly added option --with-default-use-devices-file needs to use withval.

3 years agoconfigure: update
Zdenek Kabelac [Fri, 15 Oct 2021 08:08:26 +0000 (10:08 +0200)]
configure: update

3 years agoconfigure.ac: enhance systemd testing
Zdenek Kabelac [Fri, 15 Oct 2021 07:55:08 +0000 (09:55 +0200)]
configure.ac: enhance systemd testing

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.

3 years agomakefile: enhance run-unit-test target
Zdenek Kabelac [Fri, 15 Oct 2021 07:45:26 +0000 (09:45 +0200)]
makefile: enhance run-unit-test target

Use TMPDIR for executing test and also ensure
all libraries linked to the test are from builddir.

3 years agounit-test: better check for O_DIRECT
Zdenek Kabelac [Fri, 15 Oct 2021 07:44:15 +0000 (09:44 +0200)]
unit-test: better check for O_DIRECT

Instead of guessing tmpfs usage, just directly try if we could
reopen file with O_DIRECT on the used filesystem.

3 years agoconfigure: bash var typo
Zdenek Kabelac [Thu, 14 Oct 2021 22:32:36 +0000 (00:32 +0200)]
configure: bash var typo

3 years agogcc: always initialize vg_complete
Zdenek Kabelac [Thu, 14 Oct 2021 21:43:12 +0000 (23:43 +0200)]
gcc: always initialize vg_complete

3 years agogcc: archive reoder struct vars
Zdenek Kabelac [Thu, 14 Oct 2021 21:41:47 +0000 (23:41 +0200)]
gcc: archive reoder struct vars

Easier for automatic struct initialization = { 0 } without warns
from older gcc.

3 years agoconfigure: missed braces
Zdenek Kabelac [Thu, 14 Oct 2021 22:02:11 +0000 (00:02 +0200)]
configure: missed braces

Missed [] around AS_IF internals,
Also missed to call pkg_config_init prior PKG_CHECK_MODULES().

3 years agodebug: reduce some debugging noise
Zdenek Kabelac [Thu, 14 Oct 2021 16:16:49 +0000 (18:16 +0200)]
debug: reduce some debugging noise

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.

3 years agomake: generate
Zdenek Kabelac [Thu, 14 Oct 2021 20:41:48 +0000 (22:41 +0200)]
make: generate

3 years agolog: also build without systemd_journal_support
Zdenek Kabelac [Thu, 14 Oct 2021 18:50:01 +0000 (20:50 +0200)]
log: also build without systemd_journal_support

3 years agoconfigure: updates
Zdenek Kabelac [Thu, 14 Oct 2021 20:41:09 +0000 (22:41 +0200)]
configure: updates

3 years agoconfigure.ac: improvement
Zdenek Kabelac [Thu, 14 Oct 2021 20:36:33 +0000 (22:36 +0200)]
configure.ac: improvement

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

3 years agomakefiles: use proper install prefix for python dbus
Zdenek Kabelac [Thu, 14 Oct 2021 19:39:14 +0000 (21:39 +0200)]
makefiles: use proper install prefix for python dbus

For non-standard prefix dir use correct installation path
(so the python files are not installed into user's system).

3 years agodebug: better error message
Zdenek Kabelac [Thu, 14 Oct 2021 16:44:55 +0000 (18:44 +0200)]
debug: better error message

Add more details about size difference.

3 years agoarchiving: update refactoring
Zdenek Kabelac [Thu, 14 Oct 2021 21:31:21 +0000 (23:31 +0200)]
archiving: update refactoring

Commit 5ea426e65628218569ede461312d80ba5d1c50fb handled case with
file path without '/' incorrectly - there is valid use-case so
switch 'log_error()' to valid code branch.

3 years agofix segfault handling duplicate PVs
David Teigland [Thu, 14 Oct 2021 19:02:59 +0000 (14:02 -0500)]
fix segfault handling duplicate PVs

cmd arg was missing when switching to use an alternative
duplicate dev.

3 years agofix lvmcache_add log_debug pvid
David Teigland [Wed, 13 Oct 2021 21:26:00 +0000 (16:26 -0500)]
fix lvmcache_add log_debug pvid

from previous cleanup

3 years agotoollib: remove all devices list from process_each_pv
David Teigland [Wed, 13 Oct 2021 19:13:54 +0000 (14:13 -0500)]
toollib: remove all devices list from process_each_pv

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.

3 years agodevices file: unmatching system id should just be warning
David Teigland [Wed, 13 Oct 2021 18:34:46 +0000 (13:34 -0500)]
devices file: unmatching system id should just be warning

there are likely more cases than not where the systemid
does not match and the command should still run.

3 years agofix syslog setting
David Teigland [Mon, 11 Oct 2021 22:08:05 +0000 (17:08 -0500)]
fix syslog setting

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 }.

3 years agomake: generate
Marian Csontos [Fri, 6 Aug 2021 11:23:11 +0000 (13:23 +0200)]
make: generate

3 years agolvmdbusd: Use ID_FS_TYPE UDev property in udevwatch
Vojtech Trefny [Wed, 2 Jun 2021 15:17:40 +0000 (17:17 +0200)]
lvmdbusd: Use ID_FS_TYPE UDev property in udevwatch

'.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>
3 years agoconfigure: update
Marian Csontos [Mon, 26 Apr 2021 12:27:05 +0000 (14:27 +0200)]
configure: update

3 years agonew udev autoactivation
David Teigland [Fri, 26 Mar 2021 16:39:05 +0000 (11:39 -0500)]
new udev autoactivation

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>

3 years agologging: to the systemd journal
David Teigland [Wed, 24 Mar 2021 19:19:54 +0000 (14:19 -0500)]
logging: to the systemd journal

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

3 years agopvscan: add options listlvs listvg checkcomplete
David Teigland [Wed, 9 Dec 2020 16:59:40 +0000 (10:59 -0600)]
pvscan: add options listlvs listvg checkcomplete

pvscan --cache <dev>
    . read only dev
    . create online file for dev

pvscan --listvg <dev>
    . read only dev
    . list VG using dev

pvscan --listlvs <dev>
    . read only dev
    . list VG using dev
    . list LVs using dev

pvscan --cache --listvg [--checkcomplete] <dev>
    . read only dev
    . create online file for dev
    . list VG using dev
    . [check online files and report if VG is complete]

pvscan --cache --listlvs [--checkcomplete] <dev>
    . read only dev
    . create online file for dev
    . list VG using dev
    . list LVs using dev
    . [check online files and report if VG is complete]
    . [check online files and report if LVs are complete]

[--vgonline]
can be used with --checkcomplete, to enable use of a vg online
file.  This results in only the first pvscan command to see
the complete VG to report 'VG complete', and others will report
'VG finished'.  This allows the caller to easily run a single
activation of the VG.

[--udevoutput]
can be used with --cache --listvg --checkcomplete, to enable
an output mode that prints LVM_VG_NAME_COMPLETE='vgname' that
a udev rule can import, and prevents other output from the
command (other output causes udev to ignore the command.)

The list of complete LVs is meant to be passed to lvchange -aay,
or the complete VG used with vgchange -aay.

When --checkcomplete is used, lvm assumes that that the output
will be used to trigger event-based autoactivation, so the pvscan
does nothing if event_activation=0 and --checkcomplete is used.

Example of listlvs
------------------

$ lvs -a vg -olvname,devices
  LV     Devices
  lv_a   /dev/loop0(0)
  lv_ab  /dev/loop0(1),/dev/loop1(1)
  lv_abc /dev/loop0(3),/dev/loop1(3),/dev/loop2(1)
  lv_b   /dev/loop1(0)
  lv_c   /dev/loop2(0)

$ pvscan --cache --listlvs --checkcomplete /dev/loop0
  pvscan[35680] PV /dev/loop0 online, VG vg incomplete (need 2).
  VG vg incomplete
  LV vg/lv_a complete
  LV vg/lv_ab incomplete
  LV vg/lv_abc incomplete

$ pvscan --cache --listlvs --checkcomplete /dev/loop1
  pvscan[35681] PV /dev/loop1 online, VG vg incomplete (need 1).
  VG vg incomplete
  LV vg/lv_b complete
  LV vg/lv_ab complete
  LV vg/lv_abc incomplete

$ pvscan --cache --listlvs --checkcomplete /dev/loop2
  pvscan[35682] PV /dev/loop2 online, VG vg is complete.
  VG vg complete
  LV vg/lv_c complete
  LV vg/lv_abc complete

Example of listvg
-----------------

$ pvscan --cache --listvg --checkcomplete /dev/loop0
  pvscan[35684] PV /dev/loop0 online, VG vg incomplete (need 2).
  VG vg incomplete

$ pvscan --cache --listvg --checkcomplete /dev/loop1
  pvscan[35685] PV /dev/loop1 online, VG vg incomplete (need 1).
  VG vg incomplete

$ pvscan --cache --listvg --checkcomplete /dev/loop2
  pvscan[35686] PV /dev/loop2 online, VG vg is complete.
  VG vg complete

3 years agosystem_id: new appmachineid option
David Teigland [Wed, 20 May 2020 15:59:38 +0000 (10:59 -0500)]
system_id: new appmachineid option

The new system_id_source="appmachineid" will cause
lvm to use an lvm-specific derivation of the machine-id,
instead of the machine-id directly.  This is now
recommended in place of using machineid.

3 years agoconfig: change default use_devicesfile to 1
David Teigland [Tue, 16 Mar 2021 14:52:13 +0000 (09:52 -0500)]
config: change default use_devicesfile to 1

3 years agoconfig: comment all default settings
David Teigland [Tue, 16 Mar 2021 14:51:41 +0000 (09:51 -0500)]
config: comment all default settings

3 years agocleanup: use dm_list_empty
Zdenek Kabelac [Fri, 1 Oct 2021 12:30:49 +0000 (14:30 +0200)]
cleanup: use dm_list_empty

Instant check for 'dm_list_size() == 0' without any size calc.

3 years agocleanup: skip zeroing buffer overwritten by memcpy
Zdenek Kabelac [Fri, 1 Oct 2021 12:25:59 +0000 (14:25 +0200)]
cleanup: skip zeroing buffer overwritten by memcpy

Since the buffer is going to be overwritten by memcpy, reset only last
char to 0.

Also more use of DM_LIST_INIT list.h macro.

3 years agocleanup: all lvmcache_add users pass char with 0
Zdenek Kabelac [Fri, 1 Oct 2021 12:10:39 +0000 (14:10 +0200)]
cleanup: all lvmcache_add users pass char with 0

No local copy needed, both users submit zero-end string as pv/vgid.

3 years agocleanup: always initialize historical ptr
Zdenek Kabelac [Fri, 1 Oct 2021 11:53:28 +0000 (13:53 +0200)]
cleanup: always initialize historical ptr

Set ptr for all paths.

3 years agocleanup: remove unused code
Zdenek Kabelac [Fri, 1 Oct 2021 11:47:43 +0000 (13:47 +0200)]
cleanup: remove unused code

3 years agoarchiving: refactor code to allocate less memory
Zdenek Kabelac [Fri, 1 Oct 2021 14:19:53 +0000 (16:19 +0200)]
archiving: refactor code to allocate less memory

Do not store full path with each archived name reduces memory usage if
the directory has thousands of entries and just add 'dir' path when
needed.

Also emit info print message to a user if the total size of archived
files for a VG is more then 128MiB or 8192 files.

TODO: Consider wheather adding a new 'lvm.conf  archive{option}' to support
trimming these wild archive sizes can make situation better.
We already support retain_min && retain_days  - but if user is
generating too many and too large archives with minutes - maybe archiving
should be disabled by a user - as it's not producing anything largely usable
and just slows-down command ??
If we add 'retain_max & retain_max_size' the condition will go against
each other and we need to chose priorities.

mm

3 years agometadata: enhance internal error
Zdenek Kabelac [Fri, 1 Oct 2021 11:45:34 +0000 (13:45 +0200)]
metadata: enhance internal error

Consider missing config tree from vg read to be an internal error
since we do not want to 'regenerate' this one in expesive parsing way.

Also if there is any failure on recreating committed VG, make it also
a 'vg_write' error.

3 years agodebug: fix stack tracing
Zdenek Kabelac [Fri, 1 Oct 2021 11:44:17 +0000 (13:44 +0200)]
debug: fix stack tracing

Emit stack trace only on log_error path, and avoid on 'expected'
not-found path.

3 years agometadata: simplify code
Zdenek Kabelac [Fri, 1 Oct 2021 11:43:46 +0000 (13:43 +0200)]
metadata: simplify code

3 years agodevice_id: update stacked PVs for vgchange uuid
David Teigland [Mon, 4 Oct 2021 20:47:25 +0000 (15:47 -0500)]
device_id: update stacked PVs for vgchange uuid

If a VG uuid is changed, update the device_id of any
PVs stacked on LVs in the changed VG.

3 years agohandle bad metadata text in vg_read path
David Teigland [Tue, 28 Sep 2021 19:58:03 +0000 (14:58 -0500)]
handle bad metadata text in vg_read path

Corrupt metadata text (with good mda header) was being handled
in the label_scan phase, but not in the vg_read phase.  This
was sufficient because metadata areas would always be read and
checksummed during label_scan (metadata parsing was skipped
previously as an optimization.)

This changed with the optimization in
commit 61a6f9905e87e650f0bddae83fec6923bb100a57
"metadata: optimize reading metadata copies in scan"

Now, some metadata areas will not be read and checksummed
at all during the label_scan phase, only during the vg_read
phase.  This means that bad metadata text may first be detected
in the vg_read phase.  So, add equivalent bad metadata handling
to the vg_read path to match the label_scan path.

3 years agodebug: shorter code
Zdenek Kabelac [Mon, 27 Sep 2021 09:52:16 +0000 (11:52 +0200)]
debug: shorter code

3 years agocleanup: use already known lv size
Zdenek Kabelac [Mon, 27 Sep 2021 09:00:53 +0000 (11:00 +0200)]
cleanup: use already known lv size

3 years agocleanup: reuse existing code for free path
Zdenek Kabelac [Mon, 27 Sep 2021 09:42:45 +0000 (11:42 +0200)]
cleanup: reuse existing code for free path

3 years agocleanup: use first parameter uint
Zdenek Kabelac [Fri, 24 Sep 2021 20:16:07 +0000 (22:16 +0200)]
cleanup: use first parameter uint

Easier with struct zeroing and matching assing of type uint.

3 years agocov; matching enum type
Zdenek Kabelac [Fri, 24 Sep 2021 20:14:53 +0000 (22:14 +0200)]
cov; matching enum type

3 years agocov: ignoring
Zdenek Kabelac [Fri, 24 Sep 2021 20:08:26 +0000 (22:08 +0200)]
cov: ignoring

3 years agomake: build without versionsort
Zdenek Kabelac [Fri, 24 Sep 2021 21:04:37 +0000 (23:04 +0200)]
make: build without versionsort

Reported-by: adamboardman of gemian
3 years agomake: opened can be needed for either defines case
Zdenek Kabelac [Fri, 24 Sep 2021 15:46:09 +0000 (17:46 +0200)]
make: opened can be needed for either defines case

Reported-by: adamboardman of gemian
3 years agomake: replace legacy use rindex with strrchr
Zdenek Kabelac [Fri, 24 Sep 2021 15:40:35 +0000 (17:40 +0200)]
make: replace legacy use rindex with strrchr

Seems already dropped by some systems.

Reported-by: adamboardman of gemian
3 years agomake: fix compilation for undefined RAID_INTERNAL
Zdenek Kabelac [Fri, 24 Sep 2021 15:36:29 +0000 (17:36 +0200)]
make: fix compilation for undefined RAID_INTERNAL

Reported-by: adamboardman of gemian
3 years agomake: fix compilation for some compiler
Zdenek Kabelac [Fri, 24 Sep 2021 15:18:30 +0000 (17:18 +0200)]
make: fix compilation for some compiler

Reported-by: adamboardman of gemian
3 years agoutils: define macro for ffs
Zdenek Kabelac [Fri, 24 Sep 2021 19:43:30 +0000 (21:43 +0200)]
utils: define macro for ffs

Provide ffs() macro using __builtin_ffs(), when there is missing
ffs() implementation in header file.

Reported-by: adamboardman of gemian
3 years agoconfigure: replace AC_HELP_STRING with AS_
Zdenek Kabelac [Fri, 24 Sep 2021 16:06:28 +0000 (18:06 +0200)]
configure: replace AC_HELP_STRING with AS_

Upgrade to newer autoconf setup is approaching...
Will cause large set of configure changes.

3 years agoconfigure: check ffs __builtin_ffs versionsort
Zdenek Kabelac [Fri, 24 Sep 2021 16:04:39 +0000 (18:04 +0200)]
configure: check ffs __builtin_ffs versionsort

Check for presence of ffs(), __builtin_ffs() and versionsort().

3 years agocov: make more obvious buffer is zero ended
Zdenek Kabelac [Fri, 24 Sep 2021 12:25:40 +0000 (14:25 +0200)]
cov: make more obvious buffer is zero ended

3 years agometadata: avoid excessive check of /etc/localtime
Zdenek Kabelac [Mon, 27 Sep 2021 13:52:41 +0000 (15:52 +0200)]
metadata: avoid excessive check of /etc/localtime

With larger metadata, decoding 'localtime()' for hinting time creation
of every LV may cause excessive check of /etc/localtime file.
Set TZ to ":/etc/localtime" so glibc reads this file just once
instead of check everytime if there has anything changed.

3 years agometadata: optimize reading metadata copies in scan
Zdenek Kabelac [Mon, 27 Sep 2021 15:14:56 +0000 (17:14 +0200)]
metadata: optimize reading metadata copies in scan

While being in lockless scanning phase, we can avoid reading and checking
matching metadata copies if we already know them from other PV
and just rely on matching metadata header information.

These copies will be examined later during locked metadata read/write
access.

This patch may postpone discovering some read failures to locked phase.

3 years agometadata: remember parsing size of VG metadata
Zdenek Kabelac [Mon, 27 Sep 2021 13:55:53 +0000 (15:55 +0200)]
metadata: remember parsing size of VG metadata

When creating lvm2 metadata for VG, lvm2 allocate some buffer,
and if buffer is not big enough, the buffer is 'reallocated' bigger,
and whole metadata creation is repeated until metadata fits.
We can try to use 'previous' metadata size as hint to reduce looping
here.

3 years agometadata: remember crc32 when writing vg metadata
Zdenek Kabelac [Mon, 27 Sep 2021 09:41:03 +0000 (11:41 +0200)]
metadata: remember crc32 when writing vg metadata

Preserve computed crc32 check from first written PV, just like we
preserve generated metadata.

Also there is no need to call crc32 twice on wrapping buffer with 2 calcs,
result must be always the same as with single crc32 checking.

3 years agodmsetup: fix measure handling
Zdenek Kabelac [Mon, 27 Sep 2021 16:26:35 +0000 (18:26 +0200)]
dmsetup: fix measure handling

Previous patch f853a1bc7afdebb44aeb8c1167e8784d155cad84 enabled
ima measurement unconditionally for every status call,
but it needs to be set only for 'dmsetup measure' command.

3 years agolvmlockd: update error message
David Teigland [Fri, 24 Sep 2021 20:39:36 +0000 (15:39 -0500)]
lvmlockd: update error message

refer specifically to the "use_lvmlockd" setting in lvm.conf

3 years agodevicemapper: in sync with libdm
Zdenek Kabelac [Wed, 22 Sep 2021 15:30:42 +0000 (17:30 +0200)]
devicemapper: in sync with libdm

3 years agolibdm: dmsetup measure support for IMA
Alasdair G Kergon [Tue, 13 Jul 2021 01:06:04 +0000 (02:06 +0100)]
libdm: dmsetup measure support for IMA

Add support for DM_IMA_MEASUREMENT_FLAG with
DM_TABLE_STATUS_CMD.

This feature requires DM version 4.45  (5.15+ kernels)

3 years agodevicemapper: add DM_NAME_LIST_FLAG
Zdenek Kabelac [Wed, 22 Sep 2021 19:24:39 +0000 (21:24 +0200)]
devicemapper: add DM_NAME_LIST_FLAG

Match libdm part

3 years agolibdm: support DM_NAME_LIST_FLAG
Zdenek Kabelac [Wed, 22 Sep 2021 19:22:59 +0000 (21:22 +0200)]
libdm: support DM_NAME_LIST_FLAG

Kernel patch 8b638081bd4520f63db1defc660666ec5f65bc15
introduced support to return UUID in DM_LIST_DEVICES_CMD.

Useful when asking for UUID of each device where the list
could be now returned directly with NAME && UUID for each device.

Returning UUID is done in backward-compatible way. There's one unused
32-bit word value after the event number. This patch sets the bit
DM_NAME_LIST_FLAG_HAS_UUID if UUID is present and
DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID if it isn't (if none of these bits is
set, then we have an old kernel that doesn't support returning UUIDs). The
UUID is stored after this word. The 'next' value is updated to point after
the UUID, so that old version of libdevmapper will skip the UUID without
attempting to interpret it.

3 years agogcc: match types
Zdenek Kabelac [Wed, 22 Sep 2021 14:45:33 +0000 (16:45 +0200)]
gcc: match types

3 years agogcc: use more zero length arrays
Zdenek Kabelac [Wed, 22 Sep 2021 15:05:09 +0000 (17:05 +0200)]
gcc: use more zero length arrays

Define last array struct member with zero size.

3 years agomake: generate
Zdenek Kabelac [Wed, 22 Sep 2021 12:48:58 +0000 (14:48 +0200)]
make: generate

3 years agotests: raise required version for conversion
Zdenek Kabelac [Tue, 21 Sep 2021 19:43:02 +0000 (21:43 +0200)]
tests: raise required version for conversion

Real conversion needs this version driver.
TODO: handle properly older versions.

3 years agocov: ignore leak of fd descriptor
Zdenek Kabelac [Tue, 21 Sep 2021 18:20:53 +0000 (20:20 +0200)]
cov: ignore leak of fd descriptor

There is no 'fd' leak.

This page took 0.072086 seconds and 5 git commands to generate.