]> sourceware.org Git - lvm2.git/log
lvm2.git
5 months agoudev: change action check from ACTION!="add|change" to ACTION=="remove" 10/head 1226019017
Peter Rajnoha [Thu, 7 Mar 2024 08:48:49 +0000 (09:48 +0100)]
udev: change action check from ACTION!="add|change" to ACTION=="remove"

For DM devices, the add/change/remove can appear as action for genuine
udev events.

However, there are more action types (bind, unbind, move, online, offline)
which never appear as actions for genuine DM udev events, but they can
still be synthesized (e.g. by writing "<action>" to "/sys/.../uevent" file
or by calling "udevadm trigger --action=<action>").

Let's also process these extra action types so that the udev-related content
is not lost completely, keeping all the symlinks and udev db entries just like
this was a synthetic udev event with "change" action.

Related to https://gitlab.com/lvmteam/lvm2/-/issues/4.

5 months agoWHATS_NEW: update 1226016238
Peter Rajnoha [Mon, 25 Mar 2024 07:50:37 +0000 (08:50 +0100)]
WHATS_NEW: update

Commits 6f44e1093c4a06214831d439c5db9e885b70f072 .. 038f9254d9554654197b59c160e3f775af27cdb1

5 months ago10-dm.rules: bump DM_UDEV_RULES_VSN to 3 9/head 1226000665
Martin Wilck [Fri, 1 Mar 2024 14:26:59 +0000 (15:26 +0100)]
10-dm.rules: bump DM_UDEV_RULES_VSN to 3

Bump the rules version in order to indicate that upper level rules
should consume DM_UDEV_DISABLE_OTHER_RULES_FLAG rather than DM_NOSCAN
and DM_SUSPENDED.

Also update the comments at the top of the file that describe the
exported properties, and add a note about internal device-mapper
properties.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Peter Rajnoha <prajnoha@redhat.com>
5 months agodm udev rules: don't export and save DM_NOSCAN
Martin Wilck [Fri, 1 Mar 2024 22:18:26 +0000 (23:18 +0100)]
dm udev rules: don't export and save DM_NOSCAN

DM_NOSCAN is not an official API any more and doesn't have to be
restored from the udev db. Rename it to .DM_NOSCAN.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Peter Rajnoha <prajnoha@redhat.com>
5 months agodm udev rules: don't export and save DM_SUSPENDED
Martin Wilck [Fri, 1 Mar 2024 14:16:33 +0000 (15:16 +0100)]
dm udev rules: don't export and save DM_SUSPENDED

DM_SUSPENDED is a device-mapper internal flag, which is not intended to be
used by other rules, and which is determined by 10-dm.rules from sysfs for
every uevent. Rename it to ".DM_SUSPENDED", so that it won't be saved in the
udev database.

Known consumers of DM_SUSPENDED are 66-kpartx.rules (from multipath-tools) and
99-systemd.rules (from systemd). These will have to be adapted.
11-dm-mpath.rules will be changed to use .DM_SUSPENDED.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Peter Rajnoha <prajnoha@redhat.com>
5 months ago11-dm-lvm.rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db
Martin Wilck [Fri, 1 Mar 2024 13:45:32 +0000 (14:45 +0100)]
11-dm-lvm.rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db

DM_UDEV_DISABLE_OTHER_RULES_FLAG is used as the "output" flag of the
device-mapper rules, to be consumed by non-dm rules. It is a logical OR of
several conditions that might make dm devices inaccessible. 10-dm.rules
calculates it for every uevent, whether it's genuine or spurious.

DM_SUBSYSTEM_UDEV_FLAG0 is just another flag that needs to be or'd in. We
don't need to restore the previous state of DM_UDEV_DISABLE_OTHER_RULES_FLAG.
Actually, doing so is wrong if the flag has previously been set because the
device was suspended, and the device isn't suspended anymore.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Peter Rajnoha <prajnoha@redhat.com>
5 months ago10-dm-rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db
Martin Wilck [Fri, 1 Mar 2024 11:43:36 +0000 (12:43 +0100)]
10-dm-rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db

We use DM_UDEV_DISABLE_OTHER_RULES_FLAG to tell upper non-DM layers
to keep their hands off the device in question, for any reason.
One possible reason is that the device is supended; another is that
the cookie carries the flag of the same name.

DM_SUSPENDED is not restored from the db, but evaluated anew for every
uevent. Therefore DM_UDEV_DISABLE_OTHER_RULES_FLAG shouldn't be
restored, either. Use a new variable DM_COOKIE_DISABLE_OTHER_RULES_FLAG
to save and restore the original value from the cookie.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Peter Rajnoha <prajnoha@redhat.com>
5 months ago10-dm.rules: test DISK_RO after importing properties
Martin Wilck [Tue, 5 Mar 2024 11:22:40 +0000 (12:22 +0100)]
10-dm.rules: test DISK_RO after importing properties

DISK_RO is set in the environment of a block-device uevent if and only if
the read-only (ro) attribute of the device just changed (the kernel
function set_disk_ro() was called). It is not synoymous with the "ro" sysfs
attribute; the device could very well be write-protected if DISK_RO is not
set. Device mapper-level probing is possible for DISK_RO events, but it makes
little sense, because the device propreties haven't changed as far as dm is
concerned. But we should import possible previously set device properties
to avoid confusing follow-up rules. We should do this for both DISK_RO=1
and DISK_RO=0 events.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Peter Rajnoha <prajnoha@redhat.com>
5 months ago13-dm-disk.rules: import ID_FS_TYPE
Martin Wilck [Fri, 1 Mar 2024 18:41:41 +0000 (19:41 +0100)]
13-dm-disk.rules: import ID_FS_TYPE

ID_FS_TYPE is the most important udev property for most follow-up
rules. It must be imported from the udev db if blkid can't be run.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Peter Rajnoha <prajnoha@redhat.com>
5 months agoWHATS_NEW: update 1223125248
Zdenek Kabelac [Thu, 21 Mar 2024 21:33:30 +0000 (22:33 +0100)]
WHATS_NEW: update

5 months agoconfigure: autoreconf with new version
Zdenek Kabelac [Wed, 20 Mar 2024 15:14:54 +0000 (16:14 +0100)]
configure: autoreconf with new version

Add  AC_PROG_GREP & AC_PROG_EGREP.
Rebuild with newer version of auto tools packages.

5 months agotests: check cachevol makes one table line for -cmeta
Zdenek Kabelac [Thu, 21 Mar 2024 21:24:31 +0000 (22:24 +0100)]
tests: check cachevol makes one table line for -cmeta

When using cache with cachevol, make sure the subdevice -cmeta
creates just one line.

5 months agodev_manager: pending traces only existing LV
Zdenek Kabelac [Thu, 21 Mar 2024 20:02:24 +0000 (21:02 +0100)]
dev_manager: pending traces only existing LV

Before adding LV to the dtree, check whether it's already
in dtree.

5 months agodev_manager: open_count not needed
Zdenek Kabelac [Thu, 21 Mar 2024 13:27:13 +0000 (14:27 +0100)]
dev_manager: open_count not needed

We do not need to check for open_count in these _info calls.

5 months agodev_manager: implement _cached_dm_tree_node
Zdenek Kabelac [Thu, 21 Mar 2024 16:23:33 +0000 (17:23 +0100)]
dev_manager: implement _cached_dm_tree_node

5 months agodev_manager: fix table for cache with cachevol
Zdenek Kabelac [Thu, 21 Mar 2024 20:03:44 +0000 (21:03 +0100)]
dev_manager: fix table for cache with cachevol

When using cached LV with cachevols (so not with cachepool),
the loaded table could have been using more then one mapping line
for sub devices - resulting into data corruption in some cases
when i.e. taking snapshot of such cached LV with and instead of
single line - 2 lines were generated into DM table as the code
skipped protection again repeated addition.

vg-fast_cvol-cdata: 0 16384 linear 253:2 16384
vg-fast_cvol-cdata: 16384 16384 linear 253:2 16384

New code is also refactoring to use _add_new_cvol_subdev_to_dtree
(similar _add_cvol_subdev.. ) and also the addition of subdev has
been moved after check for already processed node.
Also the cachevol sub devices are now added with the insertion
of cachevol with cached LV.

5 months agodev_manager: relocate code
Zdenek Kabelac [Thu, 21 Mar 2024 15:12:06 +0000 (16:12 +0100)]
dev_manager: relocate code

Use better place to search for cvol subdev mappings.
Add them with cachevol that is used for cache LV.

5 months agodev_manager: refactor
Zdenek Kabelac [Thu, 21 Mar 2024 20:03:29 +0000 (21:03 +0100)]
dev_manager: refactor

Use struct initilizer to setup lvid.

5 months agodebug: print names of tracked LVs
Zdenek Kabelac [Thu, 21 Mar 2024 20:01:57 +0000 (21:01 +0100)]
debug: print names of tracked LVs

Debug was printing passed in LV name, but it's more usable to see
names of LVs 'tracked' for removal.

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

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