]> sourceware.org Git - lvm2.git/log
lvm2.git
9 months agoWHATS_NEW: pvs -A 1075082744
David Teigland [Thu, 16 Nov 2023 14:46:23 +0000 (08:46 -0600)]
WHATS_NEW: pvs -A

9 months agopvs, pvscan: new option -A to show PVs outside the devices file
David Teigland [Fri, 10 Nov 2023 22:24:45 +0000 (16:24 -0600)]
pvs, pvscan: new option -A to show PVs outside the devices file

pvs -A|--allpvs
Show PVs that would otherwise be excluded by the devices file.

pvscan -A|--allpvs
Show PVs that would otherwise be excluded by the devices file.
For those devices that are included by the devices file,
their device ID is displayed in place of the usual "lvm2"
format and size.

(pvs -a|--all is unchanged, and shows devices not formatted as PVs.)

9 months agomake: generate 1073419502
Marian Csontos [Wed, 15 Nov 2023 12:35:52 +0000 (13:35 +0100)]
make: generate

9 months agoWHATS_NEW: update
Marian Csontos [Wed, 15 Nov 2023 12:35:10 +0000 (13:35 +0100)]
WHATS_NEW: update

Remove stray line

9 months agospec: Fix spec file to work with mock 1073156117
Marian Csontos [Tue, 26 Sep 2023 13:34:21 +0000 (15:34 +0200)]
spec: Fix spec file to work with mock

- missing BuildRequires

diff --git a/spec/source.inc b/spec/source.inc
index 7b44ef152..b04c500a2 100644
--- a/spec/source.inc
+++ b/spec/source.inc
@@ -12,8 +12,8 @@
 %global enable_lvmlockd 1
 %global enable_lvmpolld 1
 %global enable_dmfilemapd 0
-#%global enable_lvmlockd_dlm 0
-#%global enable_lvmlockd_sanlock 0
+#%%global enable_lvmlockd_dlm 0
+#%%global enable_lvmlockd_sanlock 0

 %if %{enable_udev}
 %service lvmpolld 1
@@ -43,7 +43,8 @@
 %with writecache internal
 %with integrity internal

-%global buildreq_udev systemd-devel
+# NOTE: Required by fedora 38+, maybe older
+%global buildreq_udev systemd-devel, systemd-units
 %global req_udev udev >= 181-1

@@ -60,15 +61,12 @@
  %global sanlock_version 3.3.0-1
  %global enable_lvmlockd_dlm 1
  %global enable_lvmlockd_sanlock 1
+ # FIXME: Check these conditions against RHEL builds!
  %if %{rhel}
-  %ifarch i686 x86_64 s390x
-   %global buildreq_lvmlockd_dlm dlm-devel >= %{dlm_version}
-  %else
+  %ifnarch i686 x86_64 s390x
    %global enable_lvmlockd_dlm 0
   %endif
-  %ifarch x86_64 ppc64le ppc64 aarch64
-   %global buildreq_lvmlockd_sanlock sanlock-devel >= %{sanlock_version}
-  %else
+  %ifnarch x86_64 ppc64le ppc64 aarch64
    %global enable_lvmlockd_sanlock 0
   %endif
  %endif
@@ -78,6 +76,12 @@
   %global enable_lvmlockd_dlm 1
  %endif
 %endif
+%if 0%{enable_lvmlockd_dlm}
+ %global buildreq_lvmlockd_dlm dlm-devel >= %{dlm_version}
+%endif
+%if 0%{enable_lvmlockd_sanlock}
+ %global buildreq_lvmlockd_sanlock sanlock-devel >= %{sanlock_version}
+%endif

 ##############################################################

@@ -164,6 +168,11 @@ Source92: build.inc
 Source93: packages.inc
 Source94: macros.inc

+BuildRequires: make
+BuildRequires: gcc
+%if %{enable_testsuite}
+BuildRequires: gcc-c++
+%endif
 BuildRequires: libselinux-devel >= 1.30.19-4, libsepol-devel
 BuildRequires: ncurses-devel
 %if %{enable_readline}
@@ -174,6 +183,9 @@ BuildRequires: libedit-devel
 %endif
 BuildRequires: module-init-tools
 BuildRequires: pkgconfig
+# TODO: Should these be conditional?
+BuildRequires: libaio-devel
+BuildRequires: libblkid-devel

 # Expands to nothing unless at least 2 arguments are given
 %define maybe() \
@@ -189,6 +201,8 @@ BuildRequires: pkgconfig
 %maybe BuildRequires: %{?buildreq_lvmlockd_sanlock}
 %maybe BuildRequires: %{?buildreq_python3_devel}
 %maybe BuildRequires: %{?buildreq_python3_setuptools}
+%maybe BuildRequires: %{?buildreq_python3_dbus}
+%maybe BuildRequires: %{?buildreq_python3_pyudev}

 %description
 LVM2 includes all of the support for handling read/write operations on

9 months agoWHATS_NEW: update
Marian Csontos [Wed, 15 Nov 2023 09:37:18 +0000 (10:37 +0100)]
WHATS_NEW: update

10 months agodevice: remove log_debug for nvme device 1067244130
David Teigland [Thu, 9 Nov 2023 19:31:01 +0000 (13:31 -0600)]
device: remove log_debug for nvme device

10 months agodevice_id: remove unused dev pointer from dev_id struct 1067230115
David Teigland [Thu, 9 Nov 2023 19:12:33 +0000 (13:12 -0600)]
device_id: remove unused dev pointer from dev_id struct

10 months agodevice_id: ensure pvid buffers are ID_LEN+1
David Teigland [Wed, 8 Nov 2023 17:46:38 +0000 (11:46 -0600)]
device_id: ensure pvid buffers are ID_LEN+1

A pvid string read from system.devices could be less
then ID_LEN since system.devices fields can be edited.
Ensure the pvid buffer is ID_LEN+1 even if the string
read from the file is shorter.

10 months agodevice_id: improve searched_devnames temp file
David Teigland [Thu, 2 Nov 2023 19:54:31 +0000 (14:54 -0500)]
device_id: improve searched_devnames temp file

Include info in the temp file to confirm that it should be used.
The temp file is meant to suppress repeated, identical searches
for the same PVIDs on the same set of devices.  Write to the file
a count and hash of the missing PVIDs and a count and hash of the
devices to search.  A subsequent command will ignore and remove
the temp file if any of these values differ.  We don't want to
suppress a search if a change has occured, and a missing PV could
be found by scanning devices.

10 months agolvmdevices: print changes for product_uuid or hostname 1064341461
David Teigland [Tue, 7 Nov 2023 20:30:48 +0000 (14:30 -0600)]
lvmdevices: print changes for product_uuid or hostname

used by the recently added refresh feature

10 months agolvmdevices: handle empty fields in new check and update 1060752941
David Teigland [Fri, 3 Nov 2023 20:15:59 +0000 (15:15 -0500)]
lvmdevices: handle empty fields in new check and update

Expand the recent commit 37773c1055913
"lvmdevices: new output and options for check and update"
to specifically cover entries with empty fields.

10 months agodevice_id: change default search_for_devnames to all 1059322176
David Teigland [Thu, 2 Nov 2023 17:10:56 +0000 (12:10 -0500)]
device_id: change default search_for_devnames to all

Problematic scenario:
. the device for a PV has no wwid, so it's identified in system.devices
  with IDTYPE=devname IDNAME=/dev/foo
. user adds/enables a wwid for the device
. on reboot, the device name changes, e.g. now /dev/bar
. the code that searches for the new device name includes an
  optimization to skip looking on devs that have a wwid, on
  the basis that a device with a wwid won't have IDTYPE=devname
. this optimization causes lvm to not look for the PV on /dev/bar
  since that device now has a wwid, so the PV is not found
. the optimization is enabled by search_for_devnames="auto"
. change the default to search_for_devnames="all" which does not
  use the problematic optimization

10 months agolvmdevices: new output and options for check and update 1059238271
David Teigland [Fri, 27 Oct 2023 22:39:32 +0000 (17:39 -0500)]
lvmdevices: new output and options for check and update

- add new comparison between old and new entries, and use this
  as the basis for new dedicated output for check and update
- add new --refresh option to search for missing PVIDs on all
  devices, and possibly update the device ID
- internally, only use the term "refresh" for cases where a
  new device ID may be found and assigned for a missing PVID

10 months agodevice_id: improve validate debug messages
David Teigland [Fri, 27 Oct 2023 22:13:25 +0000 (17:13 -0500)]
device_id: improve validate debug messages

Make the device_ids_validate messages consistent.

Consistently use "noupdate" and "update_needed" args.

10 months agodevice_id: reduce messages
David Teigland [Tue, 24 Oct 2023 21:39:15 +0000 (16:39 -0500)]
device_id: reduce messages

Don't print messages about devices file entries that are
missing or are being updated.

10 months agoREADME: update with new list info 1056712015
Zdenek Kabelac [Tue, 31 Oct 2023 18:07:47 +0000 (19:07 +0100)]
README: update with new list info

Server is changed for linux-lvm and lvm-devel mailing lists.

10 months agotests: unit test for raid status
Zdenek Kabelac [Thu, 26 Oct 2023 20:02:54 +0000 (22:02 +0200)]
tests: unit test for raid status

10 months agotests: longer timeout
Zdenek Kabelac [Thu, 26 Oct 2023 19:58:55 +0000 (21:58 +0200)]
tests: longer timeout

10 months agotests: lvmdbusd handles empty LvCommon.Devices
Tony Asleson [Wed, 25 Oct 2023 20:08:12 +0000 (15:08 -0500)]
tests: lvmdbusd handles empty LvCommon.Devices

During vdo testing with smaller block devices the test needs to determine
which PVs in a VG are unused.  This was leveraging LvCommon.Devices, but
that isn't populated when a LV is resides on a LV pool instead of a PV.
This is a known limitation of the code at this time.  For now we will walk
all the PVs in the VG looking for ones that don't have any associated LVs
and use them instead.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
10 months agodevice_mapper: raid status handle all a chars
Zdenek Kabelac [Thu, 26 Oct 2023 19:57:59 +0000 (21:57 +0200)]
device_mapper: raid status handle all a chars

When getting raid status from some older kernels, we may get an 'a'
for 'A' leg when doing initial synchronization.
This may prohibit removal of newly synchronized leg until synchronization
is finished.
So in this case change the status to look like being reported
from a newer kernel version.

10 months agotests: add devicesfile-misc 1046737321
David Teigland [Mon, 23 Oct 2023 19:29:14 +0000 (14:29 -0500)]
tests: add devicesfile-misc

10 months agodevice_id: simplify devname matching
David Teigland [Mon, 23 Oct 2023 19:27:36 +0000 (14:27 -0500)]
device_id: simplify devname matching

Handle this case directly rather than going through the
process for reading other device ids.  Also simplify
matching alternate dm devnames.

10 months agodevice_id: no idname should be NULL not empty string
David Teigland [Tue, 17 Oct 2023 21:49:30 +0000 (16:49 -0500)]
device_id: no idname should be NULL not empty string

One place was setting idname to "" instead of NULL when
there was no idname value.

10 months agodevice_id: first match non-devname device ids
David Teigland [Tue, 17 Oct 2023 18:54:31 +0000 (13:54 -0500)]
device_id: first match non-devname device ids

Incorrectly matching a dev to a devname id (due to changing devnames)
before matching the dev to a proper device id, can result in the
dev not being matched to the real id.

10 months agolibdm: report: fix invalid JSON if using DM_REPORT_OUTPUT_MULTIPLE_TIMES and selection 1046171620
Peter Rajnoha [Mon, 23 Oct 2023 11:56:55 +0000 (13:56 +0200)]
libdm: report: fix invalid JSON if using DM_REPORT_OUTPUT_MULTIPLE_TIMES and selection

When reporting in JSON format, we need to be able to find the 'last
displayed row', not just 'last row' as we did before. This is used
to decide whether to put the JSON_SEPARATOR (the ',' character)
between the lines when reporting in JSON format.

This is mainly important in case we use a combination of JSON format
and a report marked with DM_REPORT_OUTPUT_MULTIPLE_TIMES flag.
Such report may be reused several times with different selection
criteria each time. In that case, the report always contains all lines
in memory, even though some of them do not need to pass the selection
criteria that are currently used.

Without DM_REPORT_OUTPUT_MULTIPLE_TIMES flag, the report only contains
the lines that have passed the selection criteria, so the this wasn't
an issue in this case.

Fix suggested by Lars Ellenberg and reported here: https://github.com/lvmteam/lvm2/issues/130

10 months agotypo: update 1043152934
Zdenek Kabelac [Thu, 19 Oct 2023 20:05:11 +0000 (22:05 +0200)]
typo: update

10 months agotests: longer delay between table reloads
Zdenek Kabelac [Thu, 19 Oct 2023 22:02:44 +0000 (00:02 +0200)]
tests: longer delay between table reloads

It looks like there is some kernel bug/limitation
that may cause invalid table load processing:

dmsetup load LVMTEST-LV1
device-mapper: reload ioctl on LVMTEST-LV1  failed: Invalid argument
  md/raid:mdX: reshape_position too early for auto-recovery - aborting.
           md: pers->run() failed ...
device-mapper: table: 253:38: raid: Failed to run raid array (-EINVAL)
device-mapper: ioctl: error adding target to table

However ATM there is not much we can do then make delays bigger.
TODO: fixing md core...

10 months agotests: skip on problematic kernel
Zdenek Kabelac [Wed, 18 Oct 2023 11:35:08 +0000 (13:35 +0200)]
tests: skip on problematic kernel

10 months agolvconvert: fix "lvconvert -m 0" for in-sync legs
Heinz Mauelshagen [Thu, 19 Oct 2023 14:50:01 +0000 (16:50 +0200)]
lvconvert: fix "lvconvert -m 0" for in-sync legs

With commit d7e922480e04ecfb7c4d8b2d42533699ddef5c34
lvconvert -m   may fail if we try to remove 1st. leg that
is out-of-sync while other leg is in-sync.

Hot fix allows to proceed with such down conversion.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
10 months agofilters: fix condition 1040436447
Zdenek Kabelac [Wed, 18 Oct 2023 00:19:15 +0000 (02:19 +0200)]
filters: fix condition

During revork in commit cf46f4baeeaba5f79982e651c1c36c15476f7329
condition was inverted, the check for non-null string is needed.

10 months agotests: aux kills lvmdbusd more agressively 1040416585
Zdenek Kabelac [Tue, 17 Oct 2023 23:48:50 +0000 (01:48 +0200)]
tests: aux kills lvmdbusd more agressively

It's not exactly trivial to kill 'frozen' lvmdbusd.
So skip the test testing interruption and also add killall use.

10 months agotests: wait till snapshot merge is finished
Zdenek Kabelac [Tue, 17 Oct 2023 23:47:13 +0000 (01:47 +0200)]
tests: wait till snapshot merge is finished

In case test runs with lvmpolld (and lvmlockd) wait till snapshot
merge is finished.

10 months agotests: init of dmevent may take upto a second
Zdenek Kabelac [Tue, 17 Oct 2023 21:24:03 +0000 (23:24 +0200)]
tests: init of dmevent may take upto a second

Dynamic load of plugins takes a while...

10 months agotests: avoid busy looping 1039938507
Zdenek Kabelac [Tue, 17 Oct 2023 14:45:10 +0000 (16:45 +0200)]
tests: avoid busy looping

While waiting for the change, don't busy loop on CPU.
TODO: fix missing notification about device removal.

10 months agotests: ensure file is removed
Zdenek Kabelac [Tue, 17 Oct 2023 11:05:09 +0000 (13:05 +0200)]
tests: ensure file is removed

Make sure there are no previous loop results.

10 months agolvm: fix reporting path with HOME envvar
Zdenek Kabelac [Mon, 16 Oct 2023 10:57:41 +0000 (12:57 +0200)]
lvm: fix reporting path with HOME envvar

When envvar HOME is not present we were using invalid path with (null).

10 months agomake: generate
Zdenek Kabelac [Tue, 17 Oct 2023 14:48:50 +0000 (16:48 +0200)]
make: generate

10 months agodevice_id: make dmeventd use system.devices by default 1038717006
David Teigland [Mon, 2 Oct 2023 22:15:44 +0000 (17:15 -0500)]
device_id: make dmeventd use system.devices by default

When no dmeventd.devices exists, make it use system.devices
rather than no devices file at all.

10 months agodevice_id: accept wwids containing QEMU HARDDISK
David Teigland [Mon, 16 Oct 2023 20:11:29 +0000 (15:11 -0500)]
device_id: accept wwids containing QEMU HARDDISK

A wwid may be useful even when it contains the string
"QEMU HARDDISK", so allow these to be used.

10 months agodevice_id: improve handling of non-standard wwid prefixes
David Teigland [Mon, 16 Oct 2023 20:09:17 +0000 (15:09 -0500)]
device_id: improve handling of non-standard wwid prefixes

10 months agohints: correct fix for hints with device ids 1038649998
David Teigland [Mon, 16 Oct 2023 19:08:28 +0000 (14:08 -0500)]
hints: correct fix for hints with device ids

Fixes commit 63b469c1609fe5d3395b7757eebaf35a4a77ea7a
"device_id: fix hints with device ids"

It's not correct for internal filtering to be a factor
in validating the set of devs that are the basis for hints.

Instead, look for inconsistencies between a hint entry and
the corresponding devices file entry.

10 months agotests: aux mdadm_assemble skip path 1037427774
Zdenek Kabelac [Sun, 15 Oct 2023 22:11:35 +0000 (00:11 +0200)]
tests: aux mdadm_assemble skip path

If the old mdadm fails to assembly array due to its internal buggy logic
skip the test instead of failure.

10 months agotests: simplify line counting
Zdenek Kabelac [Sun, 15 Oct 2023 19:47:36 +0000 (21:47 +0200)]
tests: simplify line counting

No need for pipes

10 months agotests: better synchronization
Zdenek Kabelac [Sun, 15 Oct 2023 19:42:20 +0000 (21:42 +0200)]
tests: better synchronization

10 months agotests: fsck with yes
Zdenek Kabelac [Sun, 15 Oct 2023 17:51:43 +0000 (19:51 +0200)]
tests: fsck with yes

Fsck may need to update metadata even after clean unmount.

10 months agotests: check for blkid 1037198448
Zdenek Kabelac [Sun, 15 Oct 2023 12:43:13 +0000 (14:43 +0200)]
tests: check for blkid

When libblkid is not present (older systems) we can't use new -fs tests at
all so skip these tests.

10 months agotests: shorting batch line output
Zdenek Kabelac [Sun, 15 Oct 2023 12:42:14 +0000 (14:42 +0200)]
tests: shorting batch line output

10 months agotests: old way to disable copy contructor 1036898694
Zdenek Kabelac [Sat, 14 Oct 2023 21:37:38 +0000 (23:37 +0200)]
tests: old way to disable copy contructor

Mark them private.

10 months agotests: io stream class saver 1036894333
Zdenek Kabelac [Sat, 14 Oct 2023 14:56:26 +0000 (16:56 +0200)]
tests: io stream class saver

Restore io stream when changed by modifiers.
Also simplify getenv access.

10 months agotests: extend the usability for older systems
Zdenek Kabelac [Sat, 14 Oct 2023 19:26:39 +0000 (21:26 +0200)]
tests: extend the usability for older systems

Extend the test a bit futher so we can keep logic of resize
working similarly well for older and newer systems.

Test uses new 'aux have_fsinfo'function to regnize compiled
version of lvm.

10 months agotests: aux add have_fsinfo
Zdenek Kabelac [Sat, 14 Oct 2023 20:56:22 +0000 (22:56 +0200)]
tests: aux add have_fsinfo

Add function to detect whether lvm2 was compiled with
blkid.h with BLKID_SUBLKS_FSINFO

Currently it can be detected by support of '--fs checksize'.

10 months agocov: avoid resoure leaks on error path
Zdenek Kabelac [Sat, 14 Oct 2023 14:55:46 +0000 (16:55 +0200)]
cov: avoid resoure leaks on error path

10 months agocov: check next_get token exists
Zdenek Kabelac [Sat, 14 Oct 2023 14:54:54 +0000 (16:54 +0200)]
cov: check next_get token exists

10 months agocov: enusure pointer to idname exists
Zdenek Kabelac [Sat, 14 Oct 2023 14:53:58 +0000 (16:53 +0200)]
cov: enusure pointer to idname exists

10 months agoresize: reduce without prompt for no-fs case
Zdenek Kabelac [Sat, 14 Oct 2023 19:19:21 +0000 (21:19 +0200)]
resize: reduce without prompt for  no-fs case

Apply the same logic for 'lvreduce' which exists for newer
systems (compiled with HAVE_BLKID_SUBLKS_FSINFO)
also for older systems for one very common practical case where
the active LV does not have any blkid known signature/filesystem.

New variant recognized this situation and allowed to proceed
without requesting a prompt, while the older variant always
requested confirmation prompt.

With this patch command now works equily for both variants
for 'active LV' without signature and allows to reduce LV
without prompting.

11 months agoWHATS_NEW{_DM}: update 1036471707
Zdenek Kabelac [Fri, 13 Oct 2023 18:56:39 +0000 (20:56 +0200)]
WHATS_NEW{_DM}: update

11 months agoconfigure: update
Zdenek Kabelac [Fri, 13 Oct 2023 20:03:40 +0000 (22:03 +0200)]
configure: update

11 months agoconfigure.ac: enhancemetns
Zdenek Kabelac [Fri, 13 Oct 2023 19:28:56 +0000 (21:28 +0200)]
configure.ac: enhancemetns

Simplify configuration with enabling options:
- For --enable-dmeventd automatically --enable-cmdlib.
- For --enable-dbus-service auto --enable-notify-dbus.

Fix check linux/fiemap.h for dmfilemapd.

11 months agodebug: initialize empty string
Zdenek Kabelac [Fri, 13 Oct 2023 18:57:02 +0000 (20:57 +0200)]
debug: initialize empty string

11 months agopool: fix recalculate of pool chunk_size
Zdenek Kabelac [Fri, 13 Oct 2023 22:27:04 +0000 (00:27 +0200)]
pool: fix recalculate of pool chunk_size

Before checking seg_type of the first area, check there is
some existing area.
Since we now support error and zero segtypes, these do not have
any PV area present.

11 months agolibdm: versionion symbol for enhanced dm_task_run
Zdenek Kabelac [Fri, 13 Oct 2023 23:02:09 +0000 (01:02 +0200)]
libdm: versionion symbol for enhanced dm_task_run

When new app links with current dm_task_run() that propagates ioctl()
errno - ensure it will not be usable with older version without this
supported feature.

11 months agomakefiles: fix missing libs 1036063539
Zdenek Kabelac [Fri, 13 Oct 2023 14:34:48 +0000 (16:34 +0200)]
makefiles: fix missing libs

Recent commit  dc8837f07982663add6c1f4d87fb79fa9b6c8857
became actually to strict - we always want to build lib.a files.

11 months agodmfilemapd: ensure program_id is initialized
Zdenek Kabelac [Fri, 13 Oct 2023 14:00:08 +0000 (16:00 +0200)]
dmfilemapd: ensure program_id is initialized

Assing program_id before return 1,
and also stay C99 compatible with size_t declaration.

11 months agotests: handle empty table better 1035945506
Zdenek Kabelac [Fri, 13 Oct 2023 12:59:42 +0000 (14:59 +0200)]
tests: handle empty table better

11 months agoconfigure: update 1035915561
Zdenek Kabelac [Thu, 12 Oct 2023 17:25:04 +0000 (19:25 +0200)]
configure: update

11 months agotests: skip for missing mkfs.xfs
Zdenek Kabelac [Fri, 13 Oct 2023 12:33:39 +0000 (14:33 +0200)]
tests: skip for missing mkfs.xfs

11 months agotests: comment about version checking to aux.sh
Zdenek Kabelac [Tue, 10 Oct 2023 20:07:30 +0000 (22:07 +0200)]
tests: comment about version checking to aux.sh

If there would be futher version checking needed,
make a notice there are now two -V formats.

11 months agotests: increase delay
Zdenek Kabelac [Thu, 12 Oct 2023 23:49:04 +0000 (01:49 +0200)]
tests: increase delay

11 months agotests: some minor enhancement of udev test
Zdenek Kabelac [Sun, 8 Oct 2023 20:06:56 +0000 (22:06 +0200)]
tests: some minor enhancement of udev test

Reduce pgrep usage.

11 months agotests: fail tests when machine have suspended devs
Zdenek Kabelac [Sun, 8 Oct 2023 20:03:07 +0000 (22:03 +0200)]
tests: fail tests when machine have suspended devs

If the machine has suspended devices present in the DM table,
it's better to fail the test.

11 months agotests: use function to restart dmeventd
Zdenek Kabelac [Sat, 7 Oct 2023 08:39:56 +0000 (10:39 +0200)]
tests: use function to restart dmeventd

Move restart to single function.

11 months agoconfigure.ac: version checking for new dmpd tools
Zdenek Kabelac [Tue, 10 Oct 2023 20:03:50 +0000 (22:03 +0200)]
configure.ac: version checking for new dmpd tools

New rust version of thin_check returns now also binary name in version,
so adapt the version checking to handle this variant.

11 months agoconfigure.ac: support for static linking
Zdenek Kabelac [Thu, 12 Oct 2023 17:19:01 +0000 (19:19 +0200)]
configure.ac: support for static linking

Introduce couple configure options:

--without-blkid
--without-systemd
--without-udev

These can be useful for build with --disable-shared
where those libraries are often distibuted without
their static libraries.

However such compiled static binaries then have limitted usage.

11 months agoconfigure.ac: handle --disable-shared flag
Adam Joseph [Fri, 22 Sep 2023 06:47:38 +0000 (23:47 -0700)]
configure.ac: handle --disable-shared flag

Since LVM 2.02 it appears that compiling LVM on a platform which
lacks a shared library linker/loader will fail to produce any
binaries (dmsetup, lvm2, etc).

Adds support for the standard --disable-shared flag, and
use it to disable attempts at building shared libraries.

Modified-by: zkabelac
11 months agodevice_mapper: pair with libdm _create_and_load_v4
Zdenek Kabelac [Fri, 13 Oct 2023 11:18:13 +0000 (13:18 +0200)]
device_mapper: pair with libdm _create_and_load_v4

Apply same enhancement also for internal device mapper library
from the commit: 25ef7a7b1a876f491bd361369423d7309358f6c1.

11 months agodmstats: only generate aux data separator if group tag is defined 2/head 1034547064 1034874341
Bryn M. Reeves [Thu, 28 Sep 2023 14:06:24 +0000 (15:06 +0100)]
dmstats: only generate aux data separator if group tag is defined

Fix a bug in _stats_set_aux() that causes bogus data to appear
in the 'userdata' field of stats reports when previously grouped
regions are ungrouped:

/var/tmp/File With Spaces: Created new group with 1 region(s) as group ID 0.

Removed group ID 0 on fedora-root

Name             GrpID RgID ObjType RgStart RgSize  #Areas ArSize  ProgID  UserData
fedora-root          -    0 region    6.39g 100.00m      1 100.00m dmstats #-
                                                                           ^^
This is the aux_data separator character followed by empty user data.
The _stats_set_aux() function should only emit the separator if
there is a valid group descriptor for the region.

11 months agoAdd more dmstats integration tests
Bryn M. Reeves [Tue, 26 Sep 2023 14:16:02 +0000 (15:16 +0100)]
Add more dmstats integration tests

Add new tests for filemap, group/ungroup, histograms, precise timestamps
and userdata.

11 months agoQuote path value in --filemap debug messages
Bryn M. Reeves [Thu, 31 Aug 2023 16:08:21 +0000 (17:08 +0100)]
Quote path value in --filemap debug messages

Improves readability of debugging output when file paths contain
whitespace.

11 months agodmstats: support group aliases with embedded whitespace
Bryn M. Reeves [Mon, 25 Sep 2023 17:38:13 +0000 (18:38 +0100)]
dmstats: support group aliases with embedded whitespace

Creating a group with a name that contains whitespace causes an error in
the @stats_set_aux message:

device-mapper: message ioctl on  (253:0) failed: Invalid argument
Could not create regions from file /var/tmp/File With Spaces.

Fix this by quoting the group alias and backslash escaping any
embedded space characters.

11 months agoRefactor _stats_parse_list_region()
Bryn M. Reeves [Mon, 25 Sep 2023 15:14:57 +0000 (16:14 +0100)]
Refactor _stats_parse_list_region()

Refactor the function that parses regions from @stats_list data to
separate the parsing of variable string data from the fixed parts
of the @stats_list response.

11 months agoRename _stats_set_aux() argument
Bryn M. Reeves [Mon, 25 Sep 2023 15:13:53 +0000 (16:13 +0100)]
Rename _stats_set_aux() argument

The aux_data argument of _stats_set_aux() is the user-defined data
to be stored with the stats region. Rename the argument to better
reflect this.

11 months agodmstats: use correct value for precise in _stats_create_file()
Bryn M. Reeves [Thu, 24 Aug 2023 17:01:19 +0000 (18:01 +0100)]
dmstats: use correct value for precise in _stats_create_file()

11 months agoClean up group struct in _stats_create_group() error path
Bryn M. Reeves [Thu, 31 Aug 2023 15:59:02 +0000 (16:59 +0100)]
Clean up group struct in _stats_create_group() error path

Fix a double free in the error path from _stats_create_group() by
clearing the group struct embedded in the dm_stats handle before
returning:

    device-mapper: message ioctl on  (253:0) failed: Invalid argument
    Could not create regions from file /var/tmp/File With Spaces.
    free(): double free detected in tcache 2
    Aborted (core dumped)

11 months ago_create_and_load_v4: propagate ioctl errors back to caller 3/head 1034541995
Lennart Poettering [Wed, 11 Oct 2023 13:35:33 +0000 (15:35 +0200)]
_create_and_load_v4: propagate ioctl errors back to caller

When setting up dm-verity devices with signed root hashes it is very
useful to have a recognizable error code when a key is not present in
the kernel keyring. Turns out the kernel actually returns ENOKEY in that
case, but this gets lost in libdevmapper.

This fixes this: in _create_and_load_v4() it copies the error code from
the ioctl from the sub-tasks back to the main task field on failure.

This is not enough to make libcryptsetup actually propagate the ENOKEY
correctly, that also needs a patch to libcryptsetup, but this is part of
the puzzle.

11 months agodevice_id: fix hints with device ids 1032289643
David Teigland [Mon, 9 Oct 2023 21:08:18 +0000 (16:08 -0500)]
device_id: fix hints with device ids

Fix some interactions between device IDs and hints.  Hints
may limit the scanned devices which should not always trigger
a search for the PVs that were intentionally not scanned.
Hints should also be invalidated if they contain a device
that's become excluded by an internal filter such as the
device_id filter.

11 months agodevice_id: refresh devname idnames if any are not found
David Teigland [Tue, 10 Oct 2023 16:44:31 +0000 (11:44 -0500)]
device_id: refresh devname idnames if any are not found

Search for a PV on other devices if it's a devname entry
and the name doesn't exist on the system.  This restores
code that should not have been removed in commit 1901a47df
"device_id: fix conditions for device_ids_refresh"

11 months agodevice_id: fix lvmdevices update segfault 1028429699
David Teigland [Fri, 6 Oct 2023 17:24:34 +0000 (12:24 -0500)]
device_id: fix lvmdevices update segfault

From commit 1901a47df12
"device_id: fix conditions for device_ids_refresh"

11 months agotests: delay_dev to slowdown pvmove 1027805700
Zdenek Kabelac [Thu, 5 Oct 2023 21:17:04 +0000 (23:17 +0200)]
tests: delay_dev to slowdown pvmove

throtling mirror device is becoming useless with faster CPUS,
as way to many data can be transferred before throttling steps-in.
So prefer using  dm-delay for test and keep throttling as fallback.

11 months agotests: skip test if the memory cannot be allocated in kernel
Zdenek Kabelac [Thu, 5 Oct 2023 20:59:31 +0000 (22:59 +0200)]
tests: skip test if the memory cannot be allocated in kernel

11 months agotests: ignore failure from stop
Zdenek Kabelac [Thu, 5 Oct 2023 20:59:00 +0000 (22:59 +0200)]
tests: ignore failure from stop

11 months agotests: add delay to let dmevent initalize
Zdenek Kabelac [Thu, 5 Oct 2023 20:58:05 +0000 (22:58 +0200)]
tests: add delay to let dmevent initalize

There is short time period needed to fully initilize dmeventd and
handle 'kill' signal.

11 months agodebug: fix message severity levels
Zdenek Kabelac [Thu, 5 Oct 2023 22:00:36 +0000 (00:00 +0200)]
debug: fix message severity levels

Add some missing WARNS and correct some severity levels.

11 months agodevice_id: fix conditions for device_ids_refresh 1027316630
David Teigland [Thu, 5 Oct 2023 20:22:32 +0000 (15:22 -0500)]
device_id: fix conditions for device_ids_refresh

Fix commit 847f1dd99cb74
"device_id: rewrite validation of devname entries"

which began calling device_ids_refresh() in cases where it
was unnecessary, leading to extra PV searches and warnings.
Specifically, a command like "lvs <vg>" would use the hints
file to scan only devices for the named VG.  This means that
scanning other PVs would be skipped, and device IDs of those
PVs could not be validated because there are no PVID values
to verify.  This missing info would cause messages about
the missing info, and would cause device_ids_refresh to
search for the PVs that had been intentionally skipped.

11 months agotests: previous patch wrongly replaced tab 1026105945
Zdenek Kabelac [Wed, 4 Oct 2023 23:10:13 +0000 (01:10 +0200)]
tests: previous patch wrongly replaced tab

Tab overwrote first char instead of insert.
Actually it should be a single function.

11 months agotests: more complex check for resize of reiserfs 1026064629
Zdenek Kabelac [Wed, 4 Oct 2023 21:54:07 +0000 (23:54 +0200)]
tests: more complex check for resize of reiserfs

Detection of how the command is supposed to behave actually depends on
the configure.h compilation and whether binary is compiled with
HAVE_BLKID_SUBLKS_FSINFO.

This makes it somewhat complicated in a way how to recognize which
behavior is expected.

Currently we can eventually recognize by checking error output
of some 'random' lvresize command and see if the --fs checksize is
actually recognized and rejected.  If this changes - test needs
to be updated.

11 months agotests: utils use read without slash mangling
Zdenek Kabelac [Wed, 4 Oct 2023 20:14:13 +0000 (22:14 +0200)]
tests: utils use read without slash mangling

Do not use backslash as escape character for path.

11 months agotests: better coredump lookup
Zdenek Kabelac [Wed, 4 Oct 2023 19:02:53 +0000 (21:02 +0200)]
tests: better coredump lookup

Some bash version may have problem with contruct:
done < <(

Replace it with array reading.

11 months agotests: retry removal
Zdenek Kabelac [Wed, 4 Oct 2023 15:46:23 +0000 (17:46 +0200)]
tests: retry removal

After umout we may race with system udevd rule - so
just retry once again after 1s sleep - that should be
enough - otherwise we would need some loop here...

11 months agotests: convert to heredoc string
Zdenek Kabelac [Wed, 4 Oct 2023 15:44:07 +0000 (17:44 +0200)]
tests: convert to heredoc string

Multi-line echo command are problemat across variety of bash version
and may have produce shorter results.
Convert to stable heredoc string with 'tab' skipping <<- for better
formating.

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