]> sourceware.org Git - lvm2.git/log
lvm2.git
5 months agoman: lvm.conf mention missing array brackets 1222432041
David Teigland [Thu, 21 Mar 2024 14:16:41 +0000 (09:16 -0500)]
man: lvm.conf mention missing array brackets

5 months agolvconvert: fix displayed lv name in convert to snapshot 1220889981
David Teigland [Wed, 20 Mar 2024 14:13:06 +0000 (09:13 -0500)]
lvconvert: fix displayed lv name in convert to snapshot

5 months agotests: add more sleep time 1220555839
Zdenek Kabelac [Wed, 20 Mar 2024 09:53:06 +0000 (10:53 +0100)]
tests: add more sleep time

Give some more waiting time to testing loop.

5 months agocmdline: some simple optimization
Zdenek Kabelac [Tue, 19 Mar 2024 21:40:47 +0000 (22:40 +0100)]
cmdline: some simple optimization

Some cheap parser init speedups cutting away some cpu cycles...
Use cheaper tests in if ( && )
Avoid unnecessary strchr calls.

5 months agomakefiles: add missing cleanup targer
Zdenek Kabelac [Tue, 19 Mar 2024 19:08:01 +0000 (20:08 +0100)]
makefiles: add missing cleanup targer

5 months agoWHATS_NEW: update 1216653848
Zdenek Kabelac [Sun, 17 Mar 2024 12:30:58 +0000 (13:30 +0100)]
WHATS_NEW: update

5 months agomake: generate
Zdenek Kabelac [Sun, 17 Mar 2024 12:31:39 +0000 (13:31 +0100)]
make: generate

5 months agotests: external origin chaining
Zdenek Kabelac [Tue, 27 Feb 2024 16:27:34 +0000 (17:27 +0100)]
tests: external origin chaining

Add tests for stacked usage of external origins.

5 months agoman: lvmthin update for external origin usage
Zdenek Kabelac [Tue, 27 Feb 2024 16:16:55 +0000 (17:16 +0100)]
man: lvmthin update for external origin usage

Document usage of chaining external origins as it is now possibly to
create thinA LV in poolA which use thinB LV in poolB as it external
origin and user could create chain of such LV.

5 months agodebug: enhace device_mapper debug log for dm tree
Zdenek Kabelac [Thu, 14 Mar 2024 17:16:19 +0000 (18:16 +0100)]
debug: enhace device_mapper debug log for dm tree

5 months agodebug: trace when ignoring origin_only suspend
Zdenek Kabelac [Mon, 4 Mar 2024 10:44:50 +0000 (11:44 +0100)]
debug: trace when ignoring origin_only suspend

Add log debug message when origin_only suspend would be ignored.

5 months agolvconvert: enhance external origin conversion
Zdenek Kabelac [Fri, 15 Mar 2024 19:23:34 +0000 (20:23 +0100)]
lvconvert: enhance external origin conversion

5 months agolv: swap more lv properties
Zdenek Kabelac [Sat, 9 Mar 2024 22:21:12 +0000 (23:21 +0100)]
lv: swap more lv properties

When using swap_lv_identifiers() we were basiclly exchanging 'names'
and only according to the caller some more data were 'transfered'.

However in most cases we should swap properties like 'hostname' as
the creation information should be preserved.

So let's do the function more universal.

5 months agothin: support chaining of external origins
Zdenek Kabelac [Tue, 27 Feb 2024 16:23:01 +0000 (17:23 +0100)]
thin: support chaining of external origins

Improve support for building DM tree when there is a chain
of external origins used for LV.

For this we cannot use track_external_lv_deps as this works
only for LV with just one external origin in its device tree.

Instead add directly 'dev' to the instead of add whole LV.
This avoid possibly recurive endless loop, however we may eventally
have some problems with undiscovered/missing devices in DM tree.

5 months agothin: remove stack external origins
Zdenek Kabelac [Mon, 4 Mar 2024 10:58:32 +0000 (11:58 +0100)]
thin: remove stack external origins

Ensure external origin is deactivated during removal.
Only unused external origins can be deactivated.

5 months agothin: delayed resume for LV conversion
Zdenek Kabelac [Mon, 4 Mar 2024 10:45:35 +0000 (11:45 +0100)]
thin: delayed resume for LV conversion

When we have some existing LV and this LV is being converted to
external origin - during the DM table manipulation there is a short
moment when the LV is being 'resumed' as 'read-only' volume
while still being live as 'rw' volume i.e. we could have had
a single thin LV active twice.

To avoid such weird scenarios of dual access to a same volume, we
just postpone a resume until a moment, where the existing volume
is already suspended thus no I/O can be in flight to such device.

Note: however there is slight catch - that we now have basically
a different 'risk' case where a resume of such i.e. new external
origin LV might fail and we are already in suspend tree state -
resolving error path in this situation is untrivial as well...

5 months agothin: lock fs when converting to external origin
Zdenek Kabelac [Mon, 4 Mar 2024 10:51:56 +0000 (11:51 +0100)]
thin: lock fs when converting to external origin

Ensure suspend is locking fs, when converting LV to external origin.

5 months agothin: external origins across thin-pool
Zdenek Kabelac [Fri, 23 Feb 2024 19:52:51 +0000 (20:52 +0100)]
thin: external origins across thin-pool

Fix/support creation and usage of the external origin
across thin-pools - so thin LV can use thin LV from
some other thin-pool as external origin (read-only).

5 months agothin: validate usable volume for external origin
Zdenek Kabelac [Sun, 3 Mar 2024 22:23:04 +0000 (23:23 +0100)]
thin: validate usable volume for external origin

When creating external origin via 'lvcreate --type thin'
add the validation for LV being usable as external origin
since certain LVs cannot be really used this way.
Also call this function early during lvcreate cmdline arg
validation se we do not need to do unecesary operation.

5 months agoactivation: reduce table preloading
Zdenek Kabelac [Tue, 27 Feb 2024 16:19:30 +0000 (17:19 +0100)]
activation: reduce table preloading

Over the time the code for preloading detached LVs got unnecessarily
complicate. But actually we need to preload only LVs that
were previously non-toplevel (invisible) LVs and became visible
toplevel LVs in the precommitted metadata.

If there would be needed some other rule, it would likely be a bug in
conversion code forgetting to set visibility flag on detached LV.

This reduces number of unnecessary repeated DM tree preloading.

5 months agomakefiles: correct install srcdir
Zdenek Kabelac [Tue, 5 Mar 2024 21:00:28 +0000 (22:00 +0100)]
makefiles: correct install srcdir

When building in other dir, ensure srcdir is used to find helper
script (via vpath) through  $< usage.

Add also missing [INSTALL] prints for some installed files.

5 months agosnapshots: avoid monitoring of inactive origins
Zdenek Kabelac [Fri, 23 Feb 2024 11:54:54 +0000 (12:54 +0100)]
snapshots: avoid monitoring of inactive origins

External origins for thin volumes can be also used at the same time
as old(thick) snapshot origins. However in this case it's possible
the LV is only active as being 'external' origin, but old snapshot LVs
are not active. For this case before handling these
LVs for un/monitoring check the active state of origin LV.

This should prevent warnings of monitoring failures.

6 months agolvm.conf: update scan_lvs description 1185383911
David Teigland [Wed, 21 Feb 2024 17:08:02 +0000 (11:08 -0600)]
lvm.conf: update scan_lvs description

to better reflect the devices file existence, and
to mention layered autoactivation in lvm udev rules.

6 months agomake: generate 1182024962
Zdenek Kabelac [Mon, 19 Feb 2024 13:26:40 +0000 (14:26 +0100)]
make: generate

6 months agocleanup: remove unused code
Zdenek Kabelac [Fri, 26 Jan 2024 10:42:44 +0000 (11:42 +0100)]
cleanup: remove unused code

6 months agodevices: refactor recursive dir create
Zdenek Kabelac [Thu, 1 Feb 2024 13:14:02 +0000 (14:14 +0100)]
devices: refactor recursive dir create

Make recursive directory path creation reusable via
dir_create_recursive.

While we already have dm_create_dir() - it's not taking mode arg,
so let's make lvm's internal file helper function.

6 months agolabel: simplify code
Zdenek Kabelac [Fri, 26 Jan 2024 15:08:54 +0000 (16:08 +0100)]
label: simplify code

6 months agobcache: remove duplicate _wait_all call
Zdenek Kabelac [Fri, 26 Jan 2024 13:36:31 +0000 (14:36 +0100)]
bcache: remove duplicate _wait_all call

Since the  bcache_flush() is supposed to already use _wait_all()
remove duplicated invoce of this function.

6 months agocache: check module in modules builtin
Zdenek Kabelac [Thu, 8 Feb 2024 13:58:32 +0000 (14:58 +0100)]
cache: check module in modules builtin

Instead of parsing the whole /proc/kallsyms use faster variant
of using modprobe tool logic.

lvm2 here wants to know whether the particular DM cache policy is
present in the kernel - however since the cache policy does not have
any kernel module parameters and it can be built-in to a kernel
there is no /sys/modules directory in such case and we would need to call
modprobe everytime we want detect such case.

The old solution tried to look for particular kernel symbol
(and like not the right way, as smq_exit might be actually ommitted).

New version checks MODULES_PATH/`uname -r`/modules.builtin for
whether is present cache policy module instead of CPU expensive parsing
of kallsyms.

6 months agoconfigure: add --with-modulesdir
Zdenek Kabelac [Thu, 8 Feb 2024 13:58:16 +0000 (14:58 +0100)]
configure: add --with-modulesdir

Add configurable path for directory with kernel modules.
Following patch will use this directory to lookup:
/lib/modules/`uname -r`/modules.builtin

6 months agovdo: read VDO stats via dm message
Zdenek Kabelac [Mon, 19 Feb 2024 13:13:20 +0000 (14:13 +0100)]
vdo: read VDO stats via dm message

As the sysfs interface is seen somewhat obsolete, swith code
to prefer using DM 'stats' message to get our currently needed
info for VDO pool target.

6 months agodevices file: rename unused system.devices 1178341937
David Teigland [Mon, 5 Feb 2024 19:15:37 +0000 (13:15 -0600)]
devices file: rename unused system.devices

If lvm.conf has use_devicesfile=0 and /etc/lvm/device/system.devices
exists, then rename it to system.devices-unused.YYYYMMDD.HHMMSS.
This prevents an old, incorrect system.devices from being used in
the future if lvm.conf is changed to use_devicesfile=1.

6 months agodevices file: back up each version
David Teigland [Wed, 31 Jan 2024 18:14:02 +0000 (12:14 -0600)]
devices file: back up each version

Create backup copies of system.devices in /etc/lvm/devices/backup
named system.devices-YYYYMMDD.HHMMSS.NNNN.  NNNN is the version
counter from the file.

Each time that an lvm command writes a new system.devices file,
it also writes the same file in the backup directory.

A new comment line is added to system.devices with HASH=<num>
where <num> is a crc calculated from the uncommented lines in
system.devices.  This lets lvm detect if the file has been
modified outside of lvm itself.

If system.devices is edited directly, the next time a command
reads the file, the crc will not match the HASH value.  The
command will then rewrite system.devices with the correct HASH
value, and create a backup reflecting the edits.

A default limit of 50 backup files is kept, configurable by
lvm.conf devicesfile_backup_limit (set to 0 to disable backups.)

7 months agoudev: ignore LVs containing PVs 1170102018
David Teigland [Thu, 8 Feb 2024 20:51:46 +0000 (14:51 -0600)]
udev: ignore LVs containing PVs

If LVM LVs happen to contain PVs, they are passed to the lvm udev
rule for processing, where they should be ignored.  PVs on LVs
most likely belong to VM images, and don't belong to the host
which sees the LV.  It's unsafe for the host to use these PVs.
Without this change, the LV would be processed by pvscan which
would generally ignore it, either because of the devices file,
or because of the default lvm policy to not consider LVs as
potential PVs.  This change makes the udev rule consistent
with that policy and avoids the unnecessary system messages
produced when pvscan ignores the LV.

7 months agosystem_id: explain the reason for choosing appmachineid over machineid 1165351102
Andre Klärner [Mon, 5 Feb 2024 19:57:30 +0000 (13:57 -0600)]
system_id: explain the reason for choosing appmachineid over machineid

Since understanding the reason for choosing the appmachineid over the
direct use of machineid is not easily found, I extended to help text to
clarify this a bit.

7 months agoman: fix typo in -A description 1165236263
David Teigland [Mon, 5 Feb 2024 18:13:44 +0000 (12:13 -0600)]
man: fix typo in -A description

7 months agoarchiving: Fix doubled filename in vgcfgrestore 1149721925
Ranjith ML [Wed, 24 Jan 2024 13:05:24 +0000 (14:05 +0100)]
archiving: Fix doubled filename in vgcfgrestore

7 months agothin_pool: correct refactoring chunk_size 1141637488
Zdenek Kabelac [Wed, 17 Jan 2024 16:25:34 +0000 (17:25 +0100)]
thin_pool: correct refactoring chunk_size

Function to recalc chunk_size according to dev hints needs to be
used after chunk_size is being set to thin pool segment - correct
this ordering mistake introduced in previous refactoring commit.

7 months agovdo: correct vdo header size
Zdenek Kabelac [Wed, 17 Jan 2024 16:13:26 +0000 (17:13 +0100)]
vdo: correct vdo header size

Previous patch that introduced support for thinpool with vdo
not correctly handled header size - as this part is not fully usable
yet.  We are going to try to use the 0, but current state of code is not
yet compliant to this logic so keep vdo_header_size during conversion
and alos correctly pass through virtual_extents to vdo formating.

8 months agoWHATS_NEW: update 1133383466
Zdenek Kabelac [Wed, 10 Jan 2024 13:07:45 +0000 (14:07 +0100)]
WHATS_NEW: update

8 months agomake generate
Zdenek Kabelac [Tue, 12 Dec 2023 19:01:16 +0000 (20:01 +0100)]
make generate

8 months agotests: testing creation of compressed thin-pool
Zdenek Kabelac [Wed, 13 Dec 2023 16:37:31 +0000 (17:37 +0100)]
tests: testing creation of compressed thin-pool

8 months agolvmcmdline: support --pooldatavdo
Zdenek Kabelac [Fri, 8 Dec 2023 13:06:25 +0000 (14:06 +0100)]
lvmcmdline: support --pooldatavdo

Extend definitions for lvcreate & lvconvert to support
new option  --pooldatavdo y|n  with thinpools.

8 months agoman: document creation of VDO thin-pool
Zdenek Kabelac [Thu, 14 Dec 2023 22:21:11 +0000 (23:21 +0100)]
man: document creation of VDO thin-pool

Show some examples how to create and convert thin-pools
with VDO volume for thin-pool data.

8 months agovdo: support creation of compressed thin-pools
Zdenek Kabelac [Thu, 14 Dec 2023 13:20:19 +0000 (14:20 +0100)]
vdo: support creation of compressed thin-pools

Add code to handle creation of  thin-pool with VDO data backend
which can be seen as compressed deduplicated thin-pool.

To avoid need of changing to many internal APIs, pass the conversion
parameters for create thin-pool data volume via cmd_context.

8 months agovdo: refactor conversion to vdo lv
Zdenek Kabelac [Thu, 14 Dec 2023 13:06:54 +0000 (14:06 +0100)]
vdo: refactor conversion to vdo lv

Introduce struct vdo_convert_params {} to pass-in all the parameters
needed for the conversion of an LV to a vdopool + vdo LV.

Function convert_vdo_lv() is also able to create a new LV and swap
segments, so the passed in LV can be later on use for futher
conversion so this refactoring makes it ready for more enhanced
usage.

8 months agovdo: refactor vdo_params passing
Zdenek Kabelac [Thu, 14 Dec 2023 13:09:55 +0000 (14:09 +0100)]
vdo: refactor vdo_params passing

Introduce vdo_convert_params and use vdo_params from this structure
also with lvcreate_params.

Later we will use this for convertion of thin-pool data volume to VDO.

8 months agothin_pool: introduce --pooldatavdo
Zdenek Kabelac [Thu, 7 Dec 2023 18:17:35 +0000 (19:17 +0100)]
thin_pool: introduce --pooldatavdo

Introducing new arg --pooldatavdo y|n

8 months agopool: code refactoring
Zdenek Kabelac [Fri, 8 Dec 2023 13:10:39 +0000 (14:10 +0100)]
pool: code refactoring

Move pool related manipulation code to pool_manip.c.

8 months agothin_pool: code refactoring
Zdenek Kabelac [Thu, 7 Dec 2023 17:07:56 +0000 (18:07 +0100)]
thin_pool: code refactoring

Move common code into thin_pool_set_params()
(just like we use  cache_set_params).

8 months agocov: check for failing device_ids_read
Zdenek Kabelac [Fri, 5 Jan 2024 14:23:27 +0000 (15:23 +0100)]
cov: check for failing device_ids_read

TODO: not sure if here we should possibly exit from function.

8 months agocov: remove unneeded header
Zdenek Kabelac [Fri, 5 Jan 2024 12:21:56 +0000 (13:21 +0100)]
cov: remove unneeded header

8 months agocov: some stack tracing corrections
Zdenek Kabelac [Fri, 5 Jan 2024 14:13:42 +0000 (15:13 +0100)]
cov: some stack tracing corrections

Checking some returned values and adding/correcting
some debug tracing.

8 months agolvcreate: support vg profile for error_on_full
Zdenek Kabelac [Fri, 8 Dec 2023 13:04:55 +0000 (14:04 +0100)]
lvcreate: support vg profile for error_on_full

8 months agovdo: flip return value to int
Zdenek Kabelac [Tue, 28 Nov 2023 14:50:59 +0000 (15:50 +0100)]
vdo: flip return value to int

Change API to return just 0/1.

8 months agodev_manager: reuse _setup_task_run
Zdenek Kabelac [Mon, 6 Nov 2023 13:39:30 +0000 (14:39 +0100)]
dev_manager: reuse _setup_task_run

8 months agolv: remove unused declaration
Zdenek Kabelac [Mon, 13 Nov 2023 12:52:44 +0000 (13:52 +0100)]
lv: remove unused declaration

8 months agoactivate: use lv_layer
Zdenek Kabelac [Thu, 9 Nov 2023 14:51:51 +0000 (15:51 +0100)]
activate: use lv_layer

Avoid code duplication.

9 months agoraid: add messages to lvs command output in case RaidLVs require a refresh 1097309350
Heinz Mauelshagen [Wed, 6 Dec 2023 11:58:14 +0000 (12:58 +0100)]
raid: add messages to lvs command output in case RaidLVs require a refresh

If a RaidLV mapping is required to be refreshed as a result of temporarily failed
and recurred RAID leg device (pairs) caused by writes to the LV during failure,
the requirement is reported by volume health character r' in position 9 of the
LV's attribute field (see 'man lvs' about additional volume health characters).

As this character can be overlooked, this patch adds messages to the top
of the lvs command output informing the user explicitely about the fact.

9 months agoman: update readonly description 1096422586
David Teigland [Tue, 5 Dec 2023 18:42:38 +0000 (12:42 -0600)]
man: update readonly description

9 months agoman: add inte(g)rity to man lvs
Lukas Herbolt [Tue, 5 Dec 2023 15:08:24 +0000 (09:08 -0600)]
man: add inte(g)rity to man lvs

9 months agospec: Uncomment some globals 1089423238
Marian Csontos [Wed, 29 Nov 2023 14:26:03 +0000 (15:26 +0100)]
spec: Uncomment some globals

These were incorrectly commented out, after escaping '%' these no longer
compile on some older machines.

9 months agospec: Install and package /etc/lvm/devices 1089393814
Marian Csontos [Wed, 29 Nov 2023 14:09:36 +0000 (15:09 +0100)]
spec: Install and package /etc/lvm/devices

9 months agodmstats: Fix memory leak on error path 1088425690
Marian Csontos [Tue, 28 Nov 2023 20:41:35 +0000 (21:41 +0100)]
dmstats: Fix memory leak on error path

9 months agopost-release 1080205258
Marian Csontos [Tue, 21 Nov 2023 13:38:53 +0000 (14:38 +0100)]
post-release

9 months agopre-release
Marian Csontos [Tue, 21 Nov 2023 13:26:07 +0000 (14:26 +0100)]
pre-release

9 months agomake: generate
Marian Csontos [Thu, 16 Nov 2023 18:35:53 +0000 (19:35 +0100)]
make: generate

9 months agoWHATS_NEW: spelling
Marian Csontos [Wed, 15 Nov 2023 14:34:18 +0000 (15:34 +0100)]
WHATS_NEW: spelling

9 months agoraid: lvcreate and lvchange fail if --min_recovery_rate is defined 1080170876
Heinz Mauelshagen [Tue, 21 Nov 2023 13:17:57 +0000 (14:17 +0100)]
raid: lvcreate and lvchange fail if --min_recovery_rate is defined

Fix typos in previous commit 3589e515d.

Both commands default [raid_](min|max)recoveryrate to 0 but ensure
min_recovery_rate is not larger than max_recoveryrate.  This results
in command failure without requesting the user to also define
max_recovery_rate >= min_recovery_rate.

Fix both commands by defining max_recovery_rate = min_recoveryrate
in case "lvcreate/lvchange --minrecoveryrate Size ..." requests a
larger value than current maxrecoveryrate without also giving option

9 months agoraid: lvcreate and lvchange fail if --min_recovery_rate is defined 1079114472
Heinz Mauelshagen [Mon, 20 Nov 2023 16:05:59 +0000 (17:05 +0100)]
raid: lvcreate and lvchange fail if --min_recovery_rate is defined

Both commands default [raid_](min|max)recoveryrate to 0 but ensure
min_recovery_rate is not larger than max_recoveryrate.  This results
in command failure without requestinng the user to also define
max_recovery_rate >= min_recovery_rate.

Fix both commands by defining max_recovery_rate = min_recoveryrate
in case "lvcreate/lvchange --minrecoveryrate Size ..." requests a
larger value than current maxrecoveryrate without also giving option
"--maxrecoveryrate Size ..." with a size greater or equal than min.

9 months agolvmconfig: uncomment the report section 1076767364
David Teigland [Fri, 17 Nov 2023 19:52:49 +0000 (13:52 -0600)]
lvmconfig: uncomment the report section

so settings can be changed without uncommenting the
start/end of the section.

9 months agoWHATS_NEW: lv_attr for iorig LVs 1076750383
David Teigland [Fri, 17 Nov 2023 19:29:11 +0000 (13:29 -0600)]
WHATS_NEW: lv_attr for iorig LVs

9 months agolvs: set first attr flag for raid integrity images
David Teigland [Fri, 17 Nov 2023 17:04:22 +0000 (11:04 -0600)]
lvs: set first attr flag for raid integrity images

The first lv_attr flag is 'i' or 'I' for a raid image.
(i: raid image, I: out of sync raid image)
For integrity raid images (_iorig), the flag was not being set.

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

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