]> sourceware.org Git - lvm2.git/log
lvm2.git
2 years agopre-release v2_03_14
Marian Csontos [Wed, 20 Oct 2021 09:11:41 +0000 (11:11 +0200)]
pre-release

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

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

2 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

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

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

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

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

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

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

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

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

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

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

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

2 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().

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

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

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

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

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

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

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

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

2 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().

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

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

2 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

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

2 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

2 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).

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

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

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

2 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

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

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

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

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

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

2 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>

2 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

2 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

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

2 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

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

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

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

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

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

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

2 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

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

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

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

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

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

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

2 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

2 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

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

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

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

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

2 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().

2 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

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

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

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

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

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

2 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

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

2 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)

2 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

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

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

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

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

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

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

2 years agocov: check dev_get_size result
Zdenek Kabelac [Tue, 21 Sep 2021 16:50:26 +0000 (18:50 +0200)]
cov: check dev_get_size result

Check we have obtained some device size out of dev_get_size().

2 years agocov: sanitize function environment
Zdenek Kabelac [Tue, 21 Sep 2021 16:46:52 +0000 (18:46 +0200)]
cov: sanitize function environment

Coverity can see that function is either used with 'dev' or 'def'.

2 years agocov: check for function result
Zdenek Kabelac [Tue, 21 Sep 2021 16:45:08 +0000 (18:45 +0200)]
cov: check for function result

2 years agocov: check strchr for NULL
Zdenek Kabelac [Tue, 21 Sep 2021 16:24:30 +0000 (18:24 +0200)]
cov: check strchr for NULL

Although unlikely, ensuring coverity we not use NULL.

2 years agocov: ensuring buffer is zeroed
Zdenek Kabelac [Tue, 21 Sep 2021 16:13:05 +0000 (18:13 +0200)]
cov: ensuring buffer is zeroed

2 years agogcc-fanalyzer: zallocate memory for clean buffer
Zdenek Kabelac [Tue, 21 Sep 2021 16:36:44 +0000 (18:36 +0200)]
gcc-fanalyzer: zallocate memory for clean buffer

2 years agogcc-fanalyzer: remove unneded zeroing
Zdenek Kabelac [Tue, 21 Sep 2021 16:09:45 +0000 (18:09 +0200)]
gcc-fanalyzer: remove unneded zeroing

Since we zallocate array here, we don't need to set to NULL
and clean gcc warning about strdup leakage.

2 years agogcc-fanalyzer: helping understand answer is not null
Zdenek Kabelac [Tue, 21 Sep 2021 16:32:21 +0000 (18:32 +0200)]
gcc-fanalyzer: helping understand answer is not null

gcc can't easily see pointer 'answer' is only being checked once 'ret > 0'.

2 years agoclang: check for buffer existance
Zdenek Kabelac [Tue, 21 Sep 2021 16:07:41 +0000 (18:07 +0200)]
clang: check for buffer existance

Make obvious to analyzer we can't get NULL here.

2 years agoshellcheck: warning enhancements
Zdenek Kabelac [Tue, 21 Sep 2021 16:02:50 +0000 (18:02 +0200)]
shellcheck: warning enhancements

2 years agoshellcheck: tests fixes
Zdenek Kabelac [Tue, 21 Sep 2021 14:59:21 +0000 (16:59 +0200)]
shellcheck: tests fixes

Correcting some shell problems.

2 years agolvmcache: follow pv_id/pvid naming convention
David Teigland [Mon, 20 Sep 2021 14:32:21 +0000 (09:32 -0500)]
lvmcache: follow pv_id/pvid naming convention

name the variable pv_id_arg to follow the convention:
. "pvid" variable is null-terminated string
. "pv_id" variable is non-null-terminated struct

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