]> sourceware.org Git - lvm2.git/log
lvm2.git
3 months agotests: add tests for autoswitching to JSON format for log messages 11/head 1385984161 1386311139
Peter Rajnoha [Mon, 3 Jun 2024 12:54:02 +0000 (14:54 +0200)]
tests: add tests for autoswitching to JSON format for log messages

3 months agomake: generate
Peter Rajnoha [Wed, 20 Mar 2024 14:01:45 +0000 (15:01 +0100)]
make: generate

3 months agoreporter: simplify checking output format setting in report_format_init
Peter Rajnoha [Wed, 20 Mar 2024 12:58:04 +0000 (13:58 +0100)]
reporter: simplify checking output format setting in report_format_init

3 months agoconfig_settings: fix typo
Peter Rajnoha [Wed, 20 Mar 2024 14:00:47 +0000 (15:00 +0100)]
config_settings: fix typo

3 months agoconfig: use default log/command_log_report=1 for json/json_std output format
Peter Rajnoha [Wed, 20 Mar 2024 11:41:57 +0000 (12:41 +0100)]
config: use default log/command_log_report=1 for json/json_std output format

log/command_log_report config setting defaults to 1 now if json or json_std
output format is used (either by setting report/output_format config
setting or using --reportformat cmd line arg).

This means that if we use json/json_std output format, the command log
messages are then part of the json output too, not interleaved as
unstructured text mixed with the json output.

If log/command_log_report is set explicitly in the config, then we still
respect that, no matter what output format is used currently. In this
case, users can still separate and redirect the output by using
LVM_OUT_FD, LVM_ERR_FD and LVM_REPORT_FD so that the different types
do not interleave with the json/json_std output.

4 months agoWHATS_NEW 1380264211
Heinz Mauelshagen [Fri, 19 Jul 2024 11:28:30 +0000 (13:28 +0200)]
WHATS_NEW

4 months agolv_manip: avoid unreleased memory pool(s) message on RAID extend 1378848191
Heinz Mauelshagen [Wed, 17 Jul 2024 15:08:20 +0000 (17:08 +0200)]
lv_manip: avoid unreleased memory pool(s) message on RAID extend

In case of different PV sizes in a VG, the lvm2 allocator falls short
to define extended segments resiliently asked for 100%FREE RaidLV extension
and a RAID distinct allocation check fails.  Fix is to release a memory pool
on the resulting error path.

Until the lvm2 allocator gets enhanced (WIP) to do such complex (and other)
allocations proper, a workaround is to extend a RaidLV to any free space on
its already allocated PVs by defining those PVs on the lvextend command line
then iteratively run further such lvextend commands to extend it to its
final intended size.  Mind, this may be a non-trivial extension interation.

4 months agopages: Update release note tag and timestamp 1371117541
Marian Csontos [Fri, 12 Jul 2024 10:50:20 +0000 (12:50 +0200)]
pages: Update release note tag and timestamp

4 months agopost-release 1371114350
Marian Csontos [Fri, 12 Jul 2024 10:42:39 +0000 (12:42 +0200)]
post-release

4 months agopre-release 1371114594 v2_03_25
Marian Csontos [Fri, 12 Jul 2024 10:42:39 +0000 (12:42 +0200)]
pre-release

4 months agoRevert "dev-cache: move global variables into cmd struct" 1365196031
David Teigland [Mon, 8 Jul 2024 20:32:41 +0000 (15:32 -0500)]
Revert "dev-cache: move global variables into cmd struct"

This reverts commit 77be3250d926263db0d4daa83a4102078601bac2.

4 months agoRevert "bcache: move from global variable to cmd struct"
David Teigland [Mon, 8 Jul 2024 20:32:35 +0000 (15:32 -0500)]
Revert "bcache: move from global variable to cmd struct"

This reverts commit 5bf4efbab5f2c51f0ca1763f47a9aa227dfb915c.

4 months agobcache: move from global variable to cmd struct 1359609056
David Teigland [Wed, 3 Jul 2024 17:58:18 +0000 (12:58 -0500)]
bcache: move from global variable to cmd struct

4 months agodev-cache: move global variables into cmd struct 1359579497
David Teigland [Tue, 2 Jul 2024 21:43:34 +0000 (16:43 -0500)]
dev-cache: move global variables into cmd struct

The cmd struct is now required in many more functions, and
it's added as a function arg for most direct dev-cache function
calls.  The cmd struct is added to struct device (dev->cmd) so
that it can be accessed in many other cases where dev-cache
functions are being called from places where getting the cmd
struct is too difficult.

4 months agoconfig_file: remove unused code 1358190087
David Teigland [Tue, 2 Jul 2024 21:24:12 +0000 (16:24 -0500)]
config_file: remove unused code

config_file_read() is only used for regular files, not devices.

4 months agodevices: isolate fake device setup for config file
David Teigland [Tue, 2 Jul 2024 21:07:01 +0000 (16:07 -0500)]
devices: isolate fake device setup for config file

Freeing dev-cache from dumb fake device usage.

4 months agodevices: isolate fake dev use for mirror checks
David Teigland [Tue, 2 Jul 2024 20:07:43 +0000 (15:07 -0500)]
devices: isolate fake dev use for mirror checks

Freeing dev-cache from dumb fake device usage.

4 months agolvmlockd: fix compilation with disabled lvmlockd 1357676816
Zdenek Kabelac [Tue, 2 Jul 2024 14:58:03 +0000 (16:58 +0200)]
lvmlockd: fix compilation with disabled lvmlockd

With updated functionality for lvmlockd some prototypes
needs to be updated for builds without lvmlockd.

4 months agodevices: simpler dm devs cache naming 1356174681
David Teigland [Mon, 1 Jul 2024 16:50:59 +0000 (11:50 -0500)]
devices: simpler dm devs cache naming

The dm devs cache is separate from the ordinary dev cache,
so give the function names distinct prefixes, using
"dm_devs_cache" to prefix dm devs cache functions.

4 months agodevices: redo bcache invalidation of PVs on LV
David Teigland [Mon, 1 Jul 2024 16:30:51 +0000 (11:30 -0500)]
devices: redo bcache invalidation of PVs on LV

4 months agodevices: update dm uuid cache naming
David Teigland [Mon, 1 Jul 2024 15:50:53 +0000 (10:50 -0500)]
devices: update dm uuid cache naming

replace "dm uuid" with "dm devs" in case it begins
caching more than dm uuids.

4 months agoRevert "devices: simpler bcache invalidation of PVs on LVs"
David Teigland [Mon, 1 Jul 2024 15:58:23 +0000 (10:58 -0500)]
Revert "devices: simpler bcache invalidation of PVs on LVs"

This reverts commit 200b05cec0b75ebd1c6860ca7b2233b390cc2024.

Doesn't work to depend on lv name.

4 months agodoc: release notes for 2.03.25 1355843695
Marian Csontos [Mon, 1 Jul 2024 13:33:00 +0000 (15:33 +0200)]
doc: release notes for 2.03.25

4 months agoWHATS_NEW: update
Marian Csontos [Mon, 1 Jul 2024 13:30:40 +0000 (15:30 +0200)]
WHATS_NEW: update

4 months agodevices: simpler bcache invalidation of PVs on LVs 1353285574
David Teigland [Fri, 28 Jun 2024 23:04:25 +0000 (18:04 -0500)]
devices: simpler bcache invalidation of PVs on LVs

When a PV is stacked on an LV, the PV needs to be
dropped from bcache before the LV is processed.
The LV can be found in dev-cache using its name
rather than the devno.

4 months agodev-cache: unify dm uuid cache struct lifetimes
David Teigland [Fri, 28 Jun 2024 22:57:00 +0000 (17:57 -0500)]
dev-cache: unify dm uuid cache struct lifetimes

The list of dm devs was in the cmd struct and had a
different lifetime than the radix trees referencing
those dm devs.  Now the list and radix trees are
created and destroyed together.

4 months agodevices: update function name to dm_device_is_usable 1353107968
David Teigland [Fri, 28 Jun 2024 18:56:12 +0000 (13:56 -0500)]
devices: update function name to dm_device_is_usable

4 months agodevices: dm uuid related function names
David Teigland [Fri, 28 Jun 2024 18:35:12 +0000 (13:35 -0500)]
devices: dm uuid related function names

In the context of dm, 'device' refers to a dm device, but
in the context of lvm, 'device' refers to struct device.
Change some lvm function names to make that difference clearer.

dev_manager_get_device_list() -> dev_manager_get_dm_active_devices()
get_device_list() -> get_dm_active_devices()
device_get_uuid() -> dev_dm_uuid(), devno_dm_uuid()

4 months agolvmlockd: vgchange systemid doen't need global lock 1351247495
David Teigland [Thu, 27 Jun 2024 17:46:15 +0000 (12:46 -0500)]
lvmlockd: vgchange systemid doen't need global lock

The comment explained that the ex global lock was just
used to trigger global cache invalidation, which is no
longer needed.  This extra locking can cause problems
with LVM-activate when local and shared VGs are mixed
(and the incorrect exit code for errors was causing
problems.)

4 months agolvmlockd: after restart use existing dlm global lockspace
David Teigland [Thu, 27 Jun 2024 17:39:12 +0000 (12:39 -0500)]
lvmlockd: after restart use existing dlm global lockspace

If lvmlockd is killed and restarted, let it adopt the
existing global lockspace.

4 months agolvmlockd: skip LV unlocking with no lvmlockd or no lockspace
David Teigland [Wed, 26 Jun 2024 18:57:30 +0000 (13:57 -0500)]
lvmlockd: skip LV unlocking with no lvmlockd or no lockspace

vgchange -an vg is permitted when the vg lockspace
is not available, because LVs could still be active
for some reason, and they should be inactive when not
properly locked.  In case lvmlockd was not running, or
the lockspace was not started, the command was
unnecessarily trying and failing to unlock every LV,
printing errors for every LV.  We can skip this when
the lockspace is known to not be available.

4 months agolvmlockd: let vgchange lockstop fail with EBUSY for orphans
David Teigland [Wed, 26 Jun 2024 17:06:02 +0000 (12:06 -0500)]
lvmlockd: let vgchange lockstop fail with EBUSY for orphans

vgchange --lockstop will fail with EBUSY if orphan locks in the
lock manager prevent stopping the lockspace.  The orphan locks
can then be adopted and released, and the lockspace then stopped
cleanly.

4 months agolvmlockd: adopt options
David Teigland [Tue, 18 Jun 2024 18:26:09 +0000 (13:26 -0500)]
lvmlockd: adopt options

Lock adoption is not part of standard command behavior, but can
be used for manual recovery or cleanup from unexpected failure
cases.  Like other lockopt values, they are hidden options for
--lockopt.  Different lock managers will behave differently.
Adopting locks with lvmlockd -A1 is more accurate and automatic.

--lockopt adoptls
. for vgchange --lockstart
. adopt existing ls, or fail if no existing lockspace is found

--lockopt adoptgl | adoptvg | adoptlv
. for commands using lvmlockd locks
. adopt orphan gl/vg/lv lock, or fail the lock request if
  no orphan lock is found
. will fail if orphan lock exists with a different lock mode
. command may still continue with a failed shared lock request

--lockopt adopt
. for lockstart or any command using lvmlockd locks
. adopt existing lockspace, or start lockspace if none exists
. adopt orphan gl/vg/lv lock, or acquire new lock if no orphan found
. will fail if orphan lock exists with a different lock mode
. command may still continue with a failed shared lock request
. with dlm this option only works for ls

4 months agolvmlockd: parse lockopt string into flags
David Teigland [Tue, 18 Jun 2024 16:24:02 +0000 (11:24 -0500)]
lvmlockd: parse lockopt string into flags

4 months agolvmlockd: remove unused paramater
David Teigland [Mon, 17 Jun 2024 22:44:41 +0000 (17:44 -0500)]
lvmlockd: remove unused paramater

start_init option has never been used

4 months agovgchange: improve some lvmlockd lockstart messages
David Teigland [Mon, 17 Jun 2024 21:38:19 +0000 (16:38 -0500)]
vgchange: improve some lvmlockd lockstart messages

Stop printing "Skipping global lock: lockspace not found or started"
for vgchange --lockstart, since it's generally an inherent limitation
that the global lock isn't available until after locking is started.

Update the start delay warning to "a few seconds".

4 months agoman: lvmlockd updates
David Teigland [Mon, 17 Jun 2024 20:19:22 +0000 (15:19 -0500)]
man: lvmlockd updates

4 months agolvmlockd: allow service options
David Teigland [Mon, 17 Jun 2024 20:05:33 +0000 (15:05 -0500)]
lvmlockd: allow service options

command line options can be set in /etc/sysconfig/lvmlockd, e.g.
OPTIONS='-A1 -o2'

4 months agolvmlockd: reduce adopt delays
David Teigland [Mon, 17 Jun 2024 19:03:30 +0000 (14:03 -0500)]
lvmlockd: reduce adopt delays

4 months agolvmlockd: update debug messages
David Teigland [Fri, 14 Jun 2024 17:37:02 +0000 (12:37 -0500)]
lvmlockd: update debug messages

Reduce debug messages, and make less verbose.

4 months agolvmlockd: disable lvb for sanlock
David Teigland [Fri, 14 Jun 2024 15:59:35 +0000 (10:59 -0500)]
lvmlockd: disable lvb for sanlock

The lvb is used to hold lock versions, but lock verions are
no longer used (since the removal of lvmetad), so the lvb
is not actually useful.  Disable their use for sanlock to
avoid the extra i/o required to maintain the lvb.

4 months agolvmlockd: skip more vgremove steps with lockopt force
David Teigland [Thu, 13 Jun 2024 20:50:36 +0000 (15:50 -0500)]
lvmlockd: skip more vgremove steps with lockopt force

vgremove with --lockopt force should skip lvmlockd-related
steps and allow a forced vg cleanup, in addition to using
--nolocking to skip normal locking calls.

4 months agolvmlockd: allow forced vgchange locktype from none
David Teigland [Thu, 13 Jun 2024 18:34:23 +0000 (13:34 -0500)]
lvmlockd: allow forced vgchange locktype from none

vgchange --locktype sanlock|dlm --lockopt force <vgname>
can be used to change the lock type without lvmlockd or
the lock manager involved.

4 months agolvmlockd: avoid lockd_vg for local VGs
David Teigland [Wed, 12 Jun 2024 20:36:45 +0000 (15:36 -0500)]
lvmlockd: avoid lockd_vg for local VGs

Previously, a command would call lockd_vg() for a local VG,
which would go to lvmlockd, which would send back ENOLS,
and the command would not care when it saw the VG was local.
The pointless back-and-forth to lvmlockd for local VGs can
be avoided by checking the VG lock_type in lvmcache (which
label_scan now saves there; this wasn't the case back when
the original lockd_vg logic was added.)  If the lock_type
saved during label_scan indicates a local VG, then the
lockd_vg step is skipped.

4 months agoscripts: Install services for devices file init 1350779625
Marian Csontos [Wed, 26 Jun 2024 12:37:17 +0000 (14:37 +0200)]
scripts: Install services for devices file init

Services introduced in commit c609dedc2f035f770b5f645c4695924abf15c2ca
need installing.

4 months agopages: Fix typos
Marian Csontos [Thu, 16 May 2024 11:06:37 +0000 (13:06 +0200)]
pages: Fix typos

4 months agopages: Fix macro
Marian Csontos [Thu, 16 May 2024 10:35:54 +0000 (12:35 +0200)]
pages: Fix macro

4 months agoudev: disable suffix handling 1347921702
Zdenek Kabelac [Tue, 25 Jun 2024 21:13:54 +0000 (23:13 +0200)]
udev: disable suffix handling

The idea in the patch 6e6d4c62b for handling -suffix as
indication of private device needs to be disabled.

Some problematic cases are currently not resolvable and some
more thinking is needed.

Once fixed, we can revert this patch.

4 months agodevice_mapper: empty string for missing uuid 1342146729
Zdenek Kabelac [Fri, 21 Jun 2024 12:47:27 +0000 (14:47 +0200)]
device_mapper: empty string for missing uuid

Constify name & uuid within dm_active_device.
Set uuid to "" for case the DM device has no uuid.
Do not store "empty" device uuid in radix tree.

4 months agoWHATS_NEW: update 1341919345
Zdenek Kabelac [Fri, 21 Jun 2024 09:19:30 +0000 (11:19 +0200)]
WHATS_NEW: update

4 months agolabel: use dev iterator directly
Zdenek Kabelac [Wed, 19 Jun 2024 12:19:52 +0000 (14:19 +0200)]
label: use dev iterator directly

Avoid preparing 'extra' dm_list with devices, and just
use the iterator result directly.

4 months agodev_cache: replace dm_hash with radix_tree
Zdenek Kabelac [Wed, 19 Jun 2024 11:49:48 +0000 (13:49 +0200)]
dev_cache: replace dm_hash with radix_tree

For large device sets our dm_hash can produce larger amounf of mapping
collision and we would need to further increase our has size.

So instead use the radix_tree code which is immune agains growing size
of devices and uses memory more effiecently to store all the paths.

4 months agodev-cache: replace btree with radix_tree usage
Zdenek Kabelac [Wed, 19 Jun 2024 11:09:45 +0000 (13:09 +0200)]
dev-cache: replace btree with radix_tree usage

Instead of less efficient 'btree' switch dev_cache to use
radix_tree, that is generating more efficient tree mapping.

Some direct use of btree iteration replace with our dev_iter code.

4 months agofilter-persistent: convert to use radix_tree
Zdenek Kabelac [Sun, 2 Jun 2024 20:50:11 +0000 (22:50 +0200)]
filter-persistent: convert to use radix_tree

Convert the persisten filter to use more memory compact radix_tree as
dm_hash is bound to preallocated number of slots and stores whole
key together with value.

4 months agodev_manager: check if uuid isn't already in cache
Zdenek Kabelac [Fri, 7 Jun 2024 13:57:42 +0000 (15:57 +0200)]
dev_manager: check if uuid isn't already in cache

When DM uuid cache is available, we can possibly avoid unnecessary
status ioctl() when we check the device for 'usable' uuid.

If this test passes the existing code will got through the full check.

4 months agodevice_mapper: refactor code to lvm library
Zdenek Kabelac [Sun, 2 Jun 2024 21:10:05 +0000 (23:10 +0200)]
device_mapper: refactor code to lvm library

Move the code around caching active dm device devno, name and uuid
from device_mapper/libdm-iface to dev_cache file - as libdm layer
cares about 'decoding' ioctl data from kernel and caching for use by
lvm stays within lvm.

Introduce:
dev_cache_update_dm_devs
dev_cache_get_dm_dev_by_devno
dev_cache_get_dm_dev_by_uuid

Use radix_tree for searching.

4 months agodev_manager: no layer suffix for component
Zdenek Kabelac [Fri, 21 Jun 2024 09:08:30 +0000 (11:08 +0200)]
dev_manager: no layer suffix for component

Do not attach layer suffix to the UUID when activating component LV.

In this case we want to see allow this LV to be public, thus
such LV should not be using -layer suffix in its UUID.

This also requires that our 'cached' access will check for
both UUID (with & without suffix) which was unnoticed issue before.

This change is now necesssary since our udev rule automatically expects
any LV with -layer suffix is private and will prevent generaring
any systemd unit even when there are no 'DM' flags bits passed via
cookie mechanism while creating such LV.

4 months agogcc: pipe error path 1338899200
Zdenek Kabelac [Sun, 16 Jun 2024 13:15:44 +0000 (15:15 +0200)]
gcc: pipe error path

Close opened descriptors on failed fork path.

4 months agogcc: check cv pointer when needed
Zdenek Kabelac [Thu, 13 Jun 2024 21:06:09 +0000 (23:06 +0200)]
gcc: check cv pointer when needed

As 'cv' was already dereferenced, check for NULL with do {} while();
loop.

4 months agogcc: ensure all fmt struct element are initialized
Zdenek Kabelac [Thu, 13 Jun 2024 21:05:46 +0000 (23:05 +0200)]
gcc: ensure all fmt struct element are initialized

4 months agogcc: ensure reset of fd on error path
Zdenek Kabelac [Thu, 13 Jun 2024 21:05:19 +0000 (23:05 +0200)]
gcc: ensure reset of fd on error path

5 months agoraid_manip: prevent reshape with freed component SubLVs 1337051053
Heinz Mauelshagen [Fri, 14 Jun 2024 10:58:12 +0000 (12:58 +0200)]
raid_manip: prevent reshape with freed component SubLVs

In order to free SubLVs after a stripe removing reshape, lvconvert has
to be run without layout changes.   Prevent a layout changing request
in case any such freed SubLVs exist and inform the user about the fact
requesting to release them first.

5 months agotests: adjust lvconvert-raid-reshape-size.sh delays/timeouts
Heinz Mauelshagen [Fri, 14 Jun 2024 10:58:49 +0000 (12:58 +0200)]
tests: adjust lvconvert-raid-reshape-size.sh delays/timeouts

5 months agotests: add reshape size consistency tests script lvconvert-raid-reshape-size.sh 1327393223
Heinz Mauelshagen [Wed, 29 May 2024 16:05:19 +0000 (18:05 +0200)]
tests: add reshape size consistency tests script lvconvert-raid-reshape-size.sh

Calculates expected size before/after reshapes adding/removing stripes
to/from RaidLVs with levels 4/5/6/10 and compares it with the actual
one the block layer shows.  Stripes reshaped to are listed in the
tst_stripes variable.  mkfs/fsck/resize2fs the respective RaidLVs
to confirm ext4 can be resized accordingly without issues.

5 months agoudev: ignore private LVM devs in udev and systemd 1316155102
Peter Rajnoha [Mon, 3 Jun 2024 10:07:07 +0000 (12:07 +0200)]
udev: ignore private LVM devs in udev and systemd

We automatically ignore these devs, when lvm2 create devs,
whoever when lvm2 database is dropped or someone just
created these devs with such formated UUID, there is no
other informantion then to check DM UUID.

5 months agotests: fix wrong pos with CONFIG_PRINTK_CALLER
Zdenek Kabelac [Mon, 3 Jun 2024 11:41:06 +0000 (13:41 +0200)]
tests: fix wrong pos with CONFIG_PRINTK_CALLER

SUSE kernels distribution enables CONFIG_PRINTK_CALLER by default.

One line of cat /dev/kmsg is like:

6,904,9506214456,-,caller=T24012;loop8: detected capacity change from 0
to 354304

If CONFIG_PRINTK_CALLER is off:

6,721,53563833,-;loop0: detected capacity change from 0 to 354304

',caller=T24012' is the redundant part needed to be handled.
Otherwise pos will be lager than buf size causing sz underflowed.
Then constructor of std::string will throw a exception to break
tests:
$ make  check_local  T=shell/000-basic.sh
VERBOSE=0 ./lib/runner \
        --testdir . --outdir results \
        --flavours ndev-vanilla --only shell/000-basic.sh --skip @

running 1 tests
running: [ndev-vanilla] shell/000-basic.sh
            0:00.000Exception: basic_string::_M_create
make[1]: *** [Makefile:148: check_local] Error 1
make[1]: Leaving directory '/root/lvm2/test'
make: *** [Makefile:89: check_local] Error 2

Fix it with strchr for ';' as delimiter to get pos.

Reported-by: Su Yue <glass.su@suse.com>
5 months agoradix_tree: add radix_tree_values
Zdenek Kabelac [Sun, 2 Jun 2024 12:11:37 +0000 (14:11 +0200)]
radix_tree: add radix_tree_values

To more easily adopt radix_tree over existing code base, add
abstraction over 'radix_tree_iterate' which basically builds
an array of all traversed values, and then it's just easy to
go over all array elements.

TODO: code should be converted to use  radix_tree_iterate()
directly as it's more efficient.

Note: it can be possibly to rewrite recursive _iterate() usage
to linear travesal, not sure whether it's worth the effort
as conversion to 'radix_itree_iterator' is relatively simple.

5 months agoradix_tree: add radix_tree_lookup/insert_ptr
Zdenek Kabelac [Sat, 1 Jun 2024 17:30:33 +0000 (19:30 +0200)]
radix_tree: add radix_tree_lookup/insert_ptr

Add simple 'wrapper' inline functions to insert or return ptr lookup value.
(So the user doesn't need to deal with 'union radix_value' locally and
also it makes easier to translage some lvm2 functions to use radix_tree).

Note: If the stored 'value' would NULL, it cannot be recognized
from a case of 'not found'. So usable only when 'values' stored with
tree are not NULL.

5 months agoradix_tree: constify _iterate
Zdenek Kabelac [Sun, 2 Jun 2024 10:30:05 +0000 (12:30 +0200)]
radix_tree: constify _iterate

Use nodes as const.
Swap order of arguments.

5 months agoradix_tree: debug updates
Zdenek Kabelac [Sat, 1 Jun 2024 22:23:14 +0000 (00:23 +0200)]
radix_tree: debug updates

Some updates to _dump()  debugging function so the printed result
can be more easily examined by human.

Also print 'prefix' as string when all chars are printable.

Add 'simple' variant of _dump also to 'simple' version of radix tree
(which is however normally not compiled).

5 months agoradix_tree: api change
Zdenek Kabelac [Fri, 31 May 2024 19:46:19 +0000 (21:46 +0200)]
radix_tree: api change

Instead of using 'key state & key end' uint8_t* switch to use
void* key, & size_t keylen.  This allows easier adaptation with
lvm code base with way too much casting with every use of function.

Also correctly mark const buffers to avoid compiled warnings and
casting.

Adapt the only bcache user ATM for API change.

Adapt unit test to match changed API.

5 months agoradix_tree: indent
Zdenek Kabelac [Fri, 31 May 2024 14:21:24 +0000 (16:21 +0200)]
radix_tree: indent

Some minor indent changes to more easily read code.

5 months agogcc: drop const specifier from allocated string
Zdenek Kabelac [Thu, 30 May 2024 18:41:28 +0000 (20:41 +0200)]
gcc: drop const specifier from allocated string

Use nornal (char*) for pointers we should free().

5 months agocov: annotate already validated lv name
Zdenek Kabelac [Thu, 30 May 2024 12:40:45 +0000 (14:40 +0200)]
cov: annotate already validated lv name

5 months agocleanup: use _ for static var
Zdenek Kabelac [Thu, 30 May 2024 13:41:50 +0000 (15:41 +0200)]
cleanup: use _ for static var

Add missing '_' for some static vars.

5 months agocleanup: remove unneded headers
Zdenek Kabelac [Thu, 30 May 2024 12:24:00 +0000 (14:24 +0200)]
cleanup: remove unneded headers

As the common code was refactored to toollib, this header file
no longer needs to be included here.

5 months agodevice_id: more use of device_get_uuid
Zdenek Kabelac [Wed, 29 May 2024 21:50:38 +0000 (23:50 +0200)]
device_id: more use of device_get_uuid

Use function that is caching UUID if kernel provides functionality
from a single ioctl() call.

5 months agodev-mpath: check uuid with device_get_uuid
Zdenek Kabelac [Wed, 29 May 2024 20:43:11 +0000 (22:43 +0200)]
dev-mpath: check uuid with device_get_uuid

5 months agotypo: fix typos
Zdenek Kabelac [Tue, 28 May 2024 20:55:27 +0000 (22:55 +0200)]
typo: fix typos

Typo and indent.

5 months agocleanup: some more MAJOR MINOR unsigned
Zdenek Kabelac [Tue, 28 May 2024 14:17:53 +0000 (16:17 +0200)]
cleanup: some more MAJOR MINOR unsigned

Finish remaing missing cases where MAJOR/MINOR was casted to (int)
while we can now use it directly as 'unsigned'.

5 months agolvremove: reuse existing dm_build_dm_uuid
Zdenek Kabelac [Thu, 30 May 2024 12:17:33 +0000 (14:17 +0200)]
lvremove: reuse existing dm_build_dm_uuid

Use existing dm_build_dm_uuid() to generate LV's DM UUID.

5 months agovgimportdevices: skip global lockd locking 1312391201
David Teigland [Thu, 30 May 2024 19:51:22 +0000 (14:51 -0500)]
vgimportdevices: skip global lockd locking

Fix commit b65a2c3f3a767 "vgimportdevices: skip lvmlockd locking"
which intended to disable lvmlockd locking, but the lockd_gl_disable
flag was mistakenly set after lock_global() so it wasn't effective.
This caused vgimportdevices to fail unless locking was started.

5 months agoREADME: remove old branch names 1310480074
David Teigland [Wed, 29 May 2024 14:30:41 +0000 (09:30 -0500)]
README: remove old branch names

5 months agomake: generate 1308701008
Zdenek Kabelac [Tue, 28 May 2024 12:55:23 +0000 (14:55 +0200)]
make: generate

5 months agotests: accept new vdoformat output
Zdenek Kabelac [Mon, 27 May 2024 20:16:22 +0000 (22:16 +0200)]
tests: accept new vdoformat output

There is slight change in the printed size number.

5 months agoargs: generate configurable path
Zdenek Kabelac [Tue, 28 May 2024 12:54:00 +0000 (14:54 +0200)]
args: generate configurable path

5 months agotests: quoted DM_DEV_DIR 1307570978
Zdenek Kabelac [Mon, 27 May 2024 19:29:58 +0000 (21:29 +0200)]
tests: quoted DM_DEV_DIR

5 months agotests: use single aux lvmconf
Zdenek Kabelac [Mon, 27 May 2024 16:44:09 +0000 (18:44 +0200)]
tests: use single aux lvmconf

Reduce log size as lvmconf can process multiple settings at once.

5 months agodevice_id: use faster dm_strncpy
Zdenek Kabelac [Mon, 27 May 2024 19:31:54 +0000 (21:31 +0200)]
device_id: use faster dm_strncpy

5 months agodevice_mapper: solve no devices path
Zdenek Kabelac [Mon, 27 May 2024 16:13:47 +0000 (18:13 +0200)]
device_mapper: solve no devices path

Malloc needs to use sane value when names would be NULL.
Also for devices without 'uuid' return empty string instead of NULL.

5 months agolvremove: initilize struct list
Zdenek Kabelac [Mon, 27 May 2024 16:23:26 +0000 (18:23 +0200)]
lvremove: initilize struct list

5 months agolvremove: check for handle 1307327464
Zdenek Kabelac [Mon, 27 May 2024 15:01:25 +0000 (17:01 +0200)]
lvremove: check for handle

Get lvremove_params from non NULL handle.
Introduced in commit 47f8bda05.
TODO: any more thing needed ?

5 months agoWHATS_NEW: update 1307288018
Zdenek Kabelac [Sat, 25 May 2024 20:52:58 +0000 (22:52 +0200)]
WHATS_NEW: update

5 months agomake: generate
Zdenek Kabelac [Sun, 19 May 2024 20:35:29 +0000 (22:35 +0200)]
make: generate

5 months agocov: replace enum report_type_t with unsigned
Zdenek Kabelac [Mon, 27 May 2024 13:10:58 +0000 (15:10 +0200)]
cov: replace enum report_type_t with unsigned

Another enum used as bitfield mask.

5 months agocov: convert some more enternal field masks
Zdenek Kabelac [Mon, 27 May 2024 11:53:55 +0000 (13:53 +0200)]
cov: convert some more enternal field masks

Some more 'internal' masks misusing enums for bitfields.

5 months agocov: cleanup mask from enum to unsigned
Zdenek Kabelac [Mon, 27 May 2024 11:48:57 +0000 (13:48 +0200)]
cov: cleanup mask from enum to unsigned

Enums are single 'values' so not a proper type for bitfields.
(Probably better to use such values as defines).

Although here 'daemon_talk()' is part of library API, it's hidden
non-public API call - and moreover 'enum' and 'unsigned' are
using the same size, so linker shouldn't have any issue with
this symbol usage.

For this reason there are no 'versioning' tricks applied.

5 months agocov: annotate known use of validated lv name
Zdenek Kabelac [Mon, 27 May 2024 11:24:06 +0000 (13:24 +0200)]
cov: annotate known use of validated lv name

5 months agocleanup: remove blank spaces
Zdenek Kabelac [Mon, 27 May 2024 13:49:51 +0000 (15:49 +0200)]
cleanup: remove blank spaces

5 months agocleanup: refactor common code
Zdenek Kabelac [Mon, 27 May 2024 13:56:53 +0000 (15:56 +0200)]
cleanup: refactor common code

Refactor shared code from _get_rootvg_dev() between vgchange
and vgimportdevices to get_rootvg_dev_uuid() in toollib.c

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