]> sourceware.org Git - lvm2.git/log
lvm2.git
7 months agocov: cast to uint32 1233259584
Zdenek Kabelac [Thu, 28 Mar 2024 23:32:37 +0000 (00:32 +0100)]
cov: cast to uint32

7 months agocov: validate count is bigger then 0
Zdenek Kabelac [Thu, 28 Mar 2024 23:07:38 +0000 (00:07 +0100)]
cov: validate count is bigger then 0

To avoid teoretical underflow...

7 months agotests: better constructor
Zdenek Kabelac [Thu, 28 Mar 2024 23:07:13 +0000 (00:07 +0100)]
tests: better constructor

7 months agocov: validate major and minor
Zdenek Kabelac [Thu, 28 Mar 2024 22:37:51 +0000 (23:37 +0100)]
cov: validate major and minor

Check  major and minor is >= 0.

7 months agocov: store 64b flags
Zdenek Kabelac [Thu, 28 Mar 2024 22:21:46 +0000 (23:21 +0100)]
cov: store 64b flags

Alhtough no target is currently using that many bits for their flags,
preserve the size for loaded segment internally.

7 months agocov: validate i before underflow
Zdenek Kabelac [Thu, 28 Mar 2024 22:14:29 +0000 (23:14 +0100)]
cov: validate i before underflow

Although it can't happen in this code, ensure 'i' is not 0
before decrementing it.

7 months agocov: remove unnecessary sanity check
Zdenek Kabelac [Thu, 28 Mar 2024 21:43:16 +0000 (22:43 +0100)]
cov: remove unnecessary sanity check

This sanity check actually confused in some way Coverity
giving it some assumption about array access.

Since these two checks basically validated compiler's capability
to add and then substract the number from char pointer we likely
don't really need them - as if this base math would not work,
compiler would be having far more troubles...

So drop them - and get rid of report:
Event overrun-call: Overrunning callee's array of size 513 by...

7 months agocov: use dm_strncpy
Zdenek Kabelac [Thu, 28 Mar 2024 21:08:41 +0000 (22:08 +0100)]
cov: use dm_strncpy

Use better variant.

7 months agocov: no overwrite of const qualified fields
Zdenek Kabelac [Thu, 28 Mar 2024 20:33:53 +0000 (21:33 +0100)]
cov: no overwrite of const qualified fields

7 months agocov: reset FILE on error path
Zdenek Kabelac [Thu, 28 Mar 2024 20:15:38 +0000 (21:15 +0100)]
cov: reset FILE on error path

Although fclose() fails - we should not be retrying with
already released stucture.

7 months agotests: lvmdbusest.py faster test_z_sigint 1232333565
Tony Asleson [Wed, 27 Mar 2024 17:26:19 +0000 (12:26 -0500)]
tests: lvmdbusest.py faster test_z_sigint

Reduce #lv and intervals.

We are trying to ensure that the daemon stops while it's busy processing
its internal queues.  Decrease the number of LVs and intervals to allow
this test to complete in less time.

7 months agotests: lvmdbustest.py skip if g_tmo != 0
Tony Asleson [Wed, 27 Mar 2024 16:50:24 +0000 (11:50 -0500)]
tests: lvmdbustest.py skip if g_tmo != 0

This test doesn't have any additional value when running when g_tmo != 0.

7 months agolvmdbusd: Exit faster
Tony Asleson [Wed, 27 Mar 2024 16:49:05 +0000 (11:49 -0500)]
lvmdbusd: Exit faster

Add a global timeout value to be used for the threads to end waiting for
whatever it is they are blocked on.  The values varied from 2-5 seconds,
which is way longer than needed.  Value of 0.5 shows no CPU load when
service is running and is idle.

7 months agocleanup: drop unused code
Zdenek Kabelac [Wed, 27 Mar 2024 14:02:25 +0000 (15:02 +0100)]
cleanup: drop unused code

Code was related to long time obsoleted  vgconvert
for lvm1 to lvm2 conversion.
This code likely was missed to be removed.

7 months agodebug: update some structure members
Zdenek Kabelac [Thu, 28 Mar 2024 16:19:44 +0000 (17:19 +0100)]
debug: update some structure members

Makes pahole output look slightly better.

7 months agocommands: reduce command structure size more
Zdenek Kabelac [Thu, 28 Mar 2024 16:04:37 +0000 (17:04 +0100)]
commands: reduce command structure size more

Check for internal limits, if they would ever need to be raised report
error message and fail parsing.

7 months agocov: ensure buffer always ends with nul
Zdenek Kabelac [Thu, 28 Mar 2024 15:36:25 +0000 (16:36 +0100)]
cov: ensure buffer always ends with nul

When we print anything out of buffer, ensure there is \0.

7 months agocov: ensure nul ends string
Zdenek Kabelac [Thu, 28 Mar 2024 15:34:37 +0000 (16:34 +0100)]
cov: ensure nul ends string

7 months agotests: skip some mirror tests for polld and lockd 1228950791
Zdenek Kabelac [Wed, 27 Mar 2024 00:25:45 +0000 (01:25 +0100)]
tests: skip some mirror tests for polld and lockd

Leave just lvconvert-mirror-basic-1 test
for polld and lockd testing.

7 months agogcc: use uint16_t for counters
Zdenek Kabelac [Wed, 27 Mar 2024 00:03:08 +0000 (01:03 +0100)]
gcc: use uint16_t for counters

7 months agogcc: move declaration into ifdef
Zdenek Kabelac [Tue, 26 Mar 2024 23:46:17 +0000 (00:46 +0100)]
gcc: move declaration into ifdef

Prevent unused warning when the ifdef code is not compiled.

7 months agogcc: match signed integers
Zdenek Kabelac [Tue, 26 Mar 2024 23:36:33 +0000 (00:36 +0100)]
gcc: match signed integers

7 months agoconfigure: lcov needs -fprofile-update=atomic
Zdenek Kabelac [Tue, 26 Mar 2024 23:19:52 +0000 (00:19 +0100)]
configure: lcov needs -fprofile-update=atomic

To avoid negative counters.
See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68080

7 months agodevice_id: use dm_basename
Zdenek Kabelac [Tue, 26 Mar 2024 23:28:14 +0000 (00:28 +0100)]
device_id: use dm_basename

Avoid problems for other libc like muslc and use dm_basename.

Prototype for basename has been removed from string.h from latest musl [1]
compilers e.g. clang-18 flags the absense of prototype as error. therefore
include libgen.h for providing it.

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

Reported-by: Khem Raj <raj.khem@gmail.com>
7 months agodmsetup: refactor getopt_long usage
Zdenek Kabelac [Mon, 25 Mar 2024 18:20:55 +0000 (19:20 +0100)]
dmsetup: refactor getopt_long usage

Shuffle code to avoid using static variable to pass parsed option.
Code is now easier to follow and also number of coverity reports
will go away.
There should be no functional change.

7 months agotests: missed reduction of raid check 1226786187
Zdenek Kabelac [Mon, 25 Mar 2024 16:17:40 +0000 (17:17 +0100)]
tests: missed reduction of raid check

7 months agocov: use proper enum value
Zdenek Kabelac [Mon, 25 Mar 2024 16:17:24 +0000 (17:17 +0100)]
cov: use proper enum value

7 months agocov: ensure namelist is defined
Zdenek Kabelac [Mon, 25 Mar 2024 16:16:00 +0000 (17:16 +0100)]
cov: ensure namelist is defined

Seems coverity doesn't have good model for scandir.
Let's ensure pointer is seen as defined.

7 months agocov: validate return from display_lvname
Zdenek Kabelac [Mon, 25 Mar 2024 15:59:27 +0000 (16:59 +0100)]
cov: validate return from display_lvname

Ensure strdup will not get NULL.

7 months agocov: validate origin pointer
Zdenek Kabelac [Mon, 25 Mar 2024 15:57:53 +0000 (16:57 +0100)]
cov: validate origin pointer

Add internal error for NULL origin here.

7 months agocov: drop some unneeded continue
Zdenek Kabelac [Mon, 25 Mar 2024 15:54:11 +0000 (16:54 +0100)]
cov: drop some unneeded continue

7 months agocov: check for syscall resuls
Zdenek Kabelac [Mon, 25 Mar 2024 15:38:52 +0000 (16:38 +0100)]
cov: check for syscall resuls

7 months agocov: ensure buffer is nul ended
Zdenek Kabelac [Mon, 25 Mar 2024 15:37:04 +0000 (16:37 +0100)]
cov: ensure buffer is nul ended

Use dm_strncpy() to ensure ending nul.

7 months agotests: fix improper merge within last update 1226526725
Zdenek Kabelac [Mon, 25 Mar 2024 14:01:48 +0000 (15:01 +0100)]
tests: fix improper merge within last update

7 months agomakefiles: ignore negative errors for lcov 1226500360
Zdenek Kabelac [Mon, 25 Mar 2024 13:34:39 +0000 (14:34 +0100)]
makefiles: ignore negative errors for lcov

7 months agotests: check for raid shrink support
Zdenek Kabelac [Mon, 25 Mar 2024 12:18:20 +0000 (13:18 +0100)]
tests: check for raid shrink support

Shrink of raid LVs supported from 1.9

7 months agocov: check for to_dlm_mode return value
Zdenek Kabelac [Mon, 25 Mar 2024 13:33:40 +0000 (14:33 +0100)]
cov: check for to_dlm_mode return value

Avoid processing invalid to_dlm_mode in lm_convert_dlm.

7 months agocov: check for strftime result
Zdenek Kabelac [Mon, 25 Mar 2024 12:20:54 +0000 (13:20 +0100)]
cov: check for strftime result

7 months agodevices_id: add some syscall checks
Zdenek Kabelac [Mon, 25 Mar 2024 12:17:42 +0000 (13:17 +0100)]
devices_id: add some syscall checks

Add debug tracing for syscall failures.
Also switch some log_error to log_warn when command does not exit
with 'error' result and only warns user.
Easier error path handling.
Initialize some vars at declaration time.

7 months agogcc: ensure num has always initilized value
Zdenek Kabelac [Mon, 25 Mar 2024 10:44:36 +0000 (11:44 +0100)]
gcc: ensure num has always initilized value

7 months agocov: ensure string ends with \0 1226230192
Zdenek Kabelac [Sun, 24 Mar 2024 23:53:02 +0000 (00:53 +0100)]
cov: ensure string ends with \0

Use dm_strncpy() that ensures \0 termination.

7 months agocov: fix incorrect error check
Zdenek Kabelac [Sun, 24 Mar 2024 23:49:51 +0000 (00:49 +0100)]
cov: fix incorrect error check

Check for NULL pointer.
Fix missing release on error path.
Also dir_fd might be just != -1.

7 months agotests: update lvconvert-raid.sh
Zdenek Kabelac [Sun, 24 Mar 2024 22:06:34 +0000 (23:06 +0100)]
tests: update lvconvert-raid.sh

Handle case of removal of orig leg while it's being synchronized.

7 months agotests: update raid_leg_status check
Zdenek Kabelac [Sun, 24 Mar 2024 21:42:48 +0000 (22:42 +0100)]
tests: update raid_leg_status check

Do not wait for progres (non zero processed amount of blocks),
when the raid status already reported 'resync' or 'recover'.

7 months agotests: aux avoid discarding created loop devices
Zdenek Kabelac [Sun, 24 Mar 2024 18:23:29 +0000 (19:23 +0100)]
tests: aux avoid discarding created loop devices

Usually it's not a big deal, but couple test creates
large devices and here discard operation just excersice
CPU and consumes time.

7 months agotests: reduction needs to ignore fs
Zdenek Kabelac [Sun, 24 Mar 2024 18:22:48 +0000 (19:22 +0100)]
tests: reduction needs to ignore fs

Drop 'should' usage and use  --fs ignore when reducing raid LV.

7 months agotests: update extend of raid
Zdenek Kabelac [Sat, 23 Mar 2024 23:06:32 +0000 (00:06 +0100)]
tests: update extend of raid

Here we actually need to slowdown only $dev2 - since repair operation
is only reading data from this device and compares it with origin $dev1,
and if they match there is no write...

7 months agocommands: refactor memset
Zdenek Kabelac [Sun, 24 Mar 2024 21:44:53 +0000 (22:44 +0100)]
commands: refactor memset

Move memset() to the initialization function define_commands().

There is also not much point in clearing memory on command's exit
so drop zeroing of ~2M of RAM.

7 months agocommands: reduce structure sizes
Zdenek Kabelac [Sun, 24 Mar 2024 21:46:35 +0000 (22:46 +0100)]
commands: reduce structure sizes

Reduce slightly RAM usage of running lvm2 and use smaller fields
to count small numbers.

7 months agocommands: use nul for EOL for compiled-in buffer
Zdenek Kabelac [Sat, 23 Mar 2024 23:06:45 +0000 (00:06 +0100)]
commands: use nul for EOL for compiled-in buffer

Use \0 as EOL in compiled-in syntax description to avoid
unnecessary line copy that just replaced \n with \0.
Also use already splitted lines when possible.

7 months agoreporting: reuse existing _get_field
Zdenek Kabelac [Sun, 24 Mar 2024 13:16:18 +0000 (14:16 +0100)]
reporting: reuse existing _get_field

Use already existing _get_field() function that also
slightly optimizes 'strlen()' usage.

7 months agodev-cache: change locales just once
Zdenek Kabelac [Sat, 23 Mar 2024 23:05:57 +0000 (00:05 +0100)]
dev-cache: change locales just once

7 months agoraid: update dm_get_status_raid
Zdenek Kabelac [Sun, 24 Mar 2024 21:42:16 +0000 (22:42 +0100)]
raid: update dm_get_status_raid

Handle mismatch of reported 'dm raid' status, where the active
raid LV can be actually showing higher numebr of raid leg devices,
that the number of shown status characters.

This can happen if the raid leg is dropped during initial
resynchronization.

7 months agoudev: create /dev/disk/by-label symlinks for DM devs that have crypto as next layer 1226149768
Peter Rajnoha [Mon, 25 Mar 2024 09:16:04 +0000 (10:16 +0100)]
udev: create /dev/disk/by-label symlinks for DM devs that have crypto as next layer

We already create /dev/disk/by-uuid symlinks for DM devices which
contain crypto-type as next layer (as identified by blkid).

Also create /dev/disk/by-label symlinks as the labels can be
defined for crypto-type devices too.

Reported and fix suggested by: Patrick Plenefisch <simonpatp@gmail.com>
See also:
https://lore.kernel.org/lvm-devel/CAOCpoWfYjOVNJNt+cnOVXDHiDq2wRogTqBijcUoa7chqOLRa5Q@mail.gmail.com/

7 months agoWHATS_NEW: update 1226042252
Peter Rajnoha [Mon, 25 Mar 2024 08:14:57 +0000 (09:14 +0100)]
WHATS_NEW: update

Commits 48188d7181f735d816e0dac73a7a121ecc667f9b and eb4f744820832aff3d6da1bba14f12e91a5b3535

7 months agoUpstream db_persist udev rule from dracut 5/head 1226030064
Daan De Meyer [Wed, 29 Nov 2023 08:09:57 +0000 (09:09 +0100)]
Upstream db_persist udev rule from dracut

Setting db_persist is required for dm devices so that their properties
are carried over on switch-root from the initrd to the rootfs. This
logic has always lived in dracut
(https://github.com/dracutdevs/dracut/blob/master/modules.d/90dm/11-dm.rules).
However, this means that other initramfs generators each have to
implement and maintain the same rule which leads to unnecessary
duplication.

Instead, let's make the rule part of the upstream lvm rules, which
will ensure that generated initramfses will just work if they make
sure the lvm udev rules are installed, without having to figure out
that they have to add an extra rule themselves on top.

Identical rule in Arch Linux's lvm2 package: https://gitlab.archlinux.org/archlinux/packaging/packages/lvm2/-/blob/main/11-dm-initramfs.rules?ref_type=heads

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

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

Commits 6f44e1093c4a06214831d439c5db9e885b70f072 .. 038f9254d9554654197b59c160e3f775af27cdb1

7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 months agoWHATS_NEW: update 1223125248
Zdenek Kabelac [Thu, 21 Mar 2024 21:33:30 +0000 (22:33 +0100)]
WHATS_NEW: update

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

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

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

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

7 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

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

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

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

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

7 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

7 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

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

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

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

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

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

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

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

8 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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