]> sourceware.org Git - lvm2.git/log
lvm2.git
6 months agogcc: better initilizer for older gcc compilers
Zdenek Kabelac [Mon, 13 May 2024 20:47:36 +0000 (22:47 +0200)]
gcc: better initilizer for older gcc compilers

So use  { { } }.

6 months agoactivation: log_debug_activation
Zdenek Kabelac [Mon, 13 May 2024 21:19:15 +0000 (23:19 +0200)]
activation: log_debug_activation

Correcting debug class.

6 months agotests: reduce number of created LVs 1288857715
Zdenek Kabelac [Mon, 13 May 2024 16:00:52 +0000 (18:00 +0200)]
tests: reduce number of created LVs

lvm2 for a while already optimizes 'vgremove' operation to
a single commit when possible if all LVs can be
easily deactivated.

So the number of LVs doesn't matter much - but the tested
case 'test_delete_non_complete_job' seems to be taking
some time anyway to capture the exception.

So just reducing the running time of the test significatanly
as we don't need to create 64LVs for 4 'execution mode' runs.

6 months agocov: ensure pointer has defined value
Zdenek Kabelac [Mon, 13 May 2024 15:29:15 +0000 (17:29 +0200)]
cov: ensure pointer has defined value

Add initialization of 'fin' pointer.

6 months agodmfilemapd: assign 0 to integer
Zdenek Kabelac [Mon, 13 May 2024 15:13:08 +0000 (17:13 +0200)]
dmfilemapd: assign 0 to integer

Avoid mixing enumeration assign with 0, so just pick some integer
from filemap_monitor,  stucture will be fully zeroed anyway....

6 months agolibdevmapper-event: correct switch break
Zdenek Kabelac [Mon, 13 May 2024 15:04:48 +0000 (17:04 +0200)]
libdevmapper-event: correct switch break

Replace 'continue' within 'switch' statement with correct break.

6 months agoman: lvmlockd: remove dash in option name 1288670615
David Teigland [Mon, 13 May 2024 14:15:42 +0000 (09:15 -0500)]
man: lvmlockd: remove dash in option name

for consistency with other man pages

6 months agolvmcmdline: check for NULL 1288518747
Zdenek Kabelac [Mon, 13 May 2024 12:49:54 +0000 (14:49 +0200)]
lvmcmdline: check for NULL

Althought this code likely never is hit with NULL, just add
check to be sure.

6 months agocov: enusure _table doesn't leak
Zdenek Kabelac [Mon, 13 May 2024 12:48:46 +0000 (14:48 +0200)]
cov: enusure _table doesn't leak

If someone would enter _table multiple times by mistatek,
there is 'teroretical' leak - although doesn't matter much
in this case...

6 months agomake: generate 1288355312
Zdenek Kabelac [Mon, 13 May 2024 10:43:05 +0000 (12:43 +0200)]
make: generate

6 months agolv_types: sort order of types
Zdenek Kabelac [Mon, 13 May 2024 10:00:59 +0000 (12:00 +0200)]
lv_types: sort order of types

Order is used for man page generation (although not completely).
So place  'zero & error' to the end of list.
Keep  linear,striped,snapshot in front.
For the rest use alphabetic order.

6 months agocleanup: local const arrays
Zdenek Kabelac [Mon, 13 May 2024 09:36:54 +0000 (11:36 +0200)]
cleanup: local const arrays

No need for relocation entries for locally used arrays.

6 months agocleanup: static missed _
Zdenek Kabelac [Mon, 13 May 2024 09:33:17 +0000 (11:33 +0200)]
cleanup: static missed _

6 months agocleanup: remove unuable code path
Zdenek Kabelac [Mon, 13 May 2024 09:21:37 +0000 (11:21 +0200)]
cleanup: remove unuable code path

Eliminate some ancient unreachable code
for historical version of libdm.

6 months agocleanup: some missed public symbols static
Zdenek Kabelac [Mon, 13 May 2024 09:18:20 +0000 (11:18 +0200)]
cleanup: some missed public symbols static

6 months agolabel: make scan_bcache local 1287637635
Zdenek Kabelac [Sun, 12 May 2024 23:49:00 +0000 (01:49 +0200)]
label: make scan_bcache local

Seems there are no users of scan_bcache, so make it local.
TODO: such variable should be ideally in cmd_context.

6 months agocleanup: drop unused declared struct
Zdenek Kabelac [Sun, 12 May 2024 23:37:27 +0000 (01:37 +0200)]
cleanup: drop unused declared struct

6 months agocleanup: use static vars
Zdenek Kabelac [Mon, 13 May 2024 00:10:08 +0000 (02:10 +0200)]
cleanup: use static vars

Drop global visibility.

6 months agocleanup: add static _
Zdenek Kabelac [Sun, 12 May 2024 22:04:28 +0000 (00:04 +0200)]
cleanup: add static _

6 months agolv_type: simplier macro usage
Zdenek Kabelac [Sun, 12 May 2024 23:11:05 +0000 (01:11 +0200)]
lv_type: simplier macro usage

Use more simple macros - as there is likely not going to happen
any macro replacement - so use more effient structure layout.

6 months agolv_prop: simplier macro usage
Zdenek Kabelac [Sun, 12 May 2024 23:01:18 +0000 (01:01 +0200)]
lv_prop: simplier macro usage

Use more simple macros - as there is likely not going to happen
any macro replacement - so use more effient structure layout.

6 months agocommand: validation code only for man-generator
Zdenek Kabelac [Sun, 12 May 2024 20:07:58 +0000 (22:07 +0200)]
command: validation code only for man-generator

Don't waste time with string order validation within command,
check within  'man-generator -c' is enough.

6 months agocommand: refactor inner loop
Zdenek Kabelac [Sun, 12 May 2024 16:29:31 +0000 (18:29 +0200)]
command: refactor inner loop

Move part of the 'inner' loop which is would be otherwise
always production same results for all  'opt_enum' values
out of the loop, so it can be evaluated just once.

6 months agocommand: replace strcmp with enum
Zdenek Kabelac [Sun, 12 May 2024 15:12:19 +0000 (17:12 +0200)]
command: replace strcmp with enum

Here we already know 'enum' value, so compare
just those instead of calling strcmp().

6 months agolvmcmdline: runtime function resolving
Zdenek Kabelac [Sun, 12 May 2024 14:46:02 +0000 (16:46 +0200)]
lvmcmdline: runtime function resolving

Instead of resolving and storing 'command_fn'
withing 'struct command' use just funtion enum
and resolve function pointer just in place,
where it is really needed - first try to resolve
'new style' and fallback to 'old style' named.

6 months agocommand: use command_id_to_enum
Zdenek Kabelac [Sun, 12 May 2024 14:00:48 +0000 (16:00 +0200)]
command: use command_id_to_enum

Instead of storing command_id as string, direcly
translate string to enum index and use 'command_enum()'
to get string when needed for printing.

This way we can easily detect error in the structure
while parsing it - and we can later avoid separate
'translation' loop.

6 months agocommand: refactor code for simplier lookup
Zdenek Kabelac [Sun, 12 May 2024 13:39:18 +0000 (15:39 +0200)]
command: refactor code for simplier lookup

We can more efficiently use command_name struct to
lookup for  lvm_command_enum and avoid many repeated
command name searches since we already know
the enum index that is now stored in 'struct command'.

6 months agolvmcmdline: use strcut as const
Zdenek Kabelac [Sun, 12 May 2024 10:04:54 +0000 (12:04 +0200)]
lvmcmdline: use strcut as const

Constity members in cmdline_context, would be nice, to replace
this static struct with couple function calls.

Also replace some 'while' loops with for loops, so code
is more readable.

6 months agocommand: return if already factored
Zdenek Kabelac [Sun, 12 May 2024 08:17:11 +0000 (10:17 +0200)]
command: return if already factored

We can directly return here, when we spot already counted varitants.

6 months agocommand: refactor struct command_name
Zdenek Kabelac [Sat, 11 May 2024 23:14:14 +0000 (01:14 +0200)]
command: refactor struct command_name

Split struct command_name to the constant part (keep the name)
and new 'struct command_name_args' which holds runtime computed
info.   To get to the _args part - we can easily use
lvm_command_enum as equivalent index.

Constified part 'struct command_name' is now fully stored
in .data.rel.ro segment, while command_name_args part goes
to .bss segment.

Code will be further reduced with next refactoring.

6 months agocommand: better const usage for struct cmd_name
Zdenek Kabelac [Sat, 11 May 2024 20:27:36 +0000 (22:27 +0200)]
command: better const usage for struct cmd_name

No need to store _CMD string - as it's not used anywhere.
Use LVM_COMMAND_COUNT as end of array.

6 months agocommand: reduce struct size
Zdenek Kabelac [Sat, 11 May 2024 20:00:42 +0000 (22:00 +0200)]
command: reduce struct size

Reduce memory usage for parser.
If the sizes would need to be bigger, man-generator warns.
For struct command_name  use just uint8_t to keep 1|0.

6 months agocommand: no need to duplicate const mem
Zdenek Kabelac [Sat, 11 May 2024 19:59:48 +0000 (21:59 +0200)]
command: no need to duplicate const mem

No need to duplicate const char* here as
we refer already constant string in .rodata segment.

6 months agocommand: futher move to single struct
Zdenek Kabelac [Fri, 10 May 2024 22:42:49 +0000 (00:42 +0200)]
command: futher move to single struct

Refactor code to not allocate memory for rule->opts,
instead use uint16_t array of MAX_RULE_OPTS within cmd_rule.

Also print more info if array would not be enough (>= 8).

6 months agotests: check vg fields with one command
Zdenek Kabelac [Fri, 10 May 2024 20:04:06 +0000 (22:04 +0200)]
tests: check vg fields with one command

6 months agotests: keep more LVs inactive
Zdenek Kabelac [Fri, 10 May 2024 19:42:00 +0000 (21:42 +0200)]
tests: keep more LVs inactive

6 months agotests: mask result from kill command
Zdenek Kabelac [Fri, 10 May 2024 19:41:13 +0000 (21:41 +0200)]
tests: mask result from kill command

6 months agotests: wait for running dmeventd 1286199964
Zdenek Kabelac [Fri, 10 May 2024 15:48:47 +0000 (17:48 +0200)]
tests: wait for running dmeventd

Add slight delay for waiting until 'started' dmeventd is
responsing to other 'dmeventd -i' command.

TODO: race observed here is somewhat unclear, might need some more
details

6 months agotests: kill process in flock group
Zdenek Kabelac [Fri, 10 May 2024 15:36:48 +0000 (17:36 +0200)]
tests: kill process in flock group

There is no reason to wait for 10sec when removing 'vg' at test
exit - we just need to kill 'sleep 10' process forked from flock.

(Not using 'flock -F' as this flag is not across all machines used
for testing)

6 months agotests: skip test on systems without delay_dev
Zdenek Kabelac [Fri, 10 May 2024 15:35:07 +0000 (17:35 +0200)]
tests: skip test on systems without delay_dev

On such systems this test only sleeps for 30sec.

6 months agolibdm: reapply "fix condition" 1285949545
Zdenek Kabelac [Fri, 10 May 2024 11:53:11 +0000 (13:53 +0200)]
libdm: reapply "fix condition"

This reverts commit d16a8f80e9dd21d97b10056858a21b7e8fbd8c94.
So the correction was OK, however we missed to fix also
cut&paste bug here - as the second check should be
actually checking  field->type.

6 months agoWHATS_NEW: update 1285301739
Zdenek Kabelac [Thu, 9 May 2024 23:08:55 +0000 (01:08 +0200)]
WHATS_NEW: update

6 months agomake: generate
Zdenek Kabelac [Thu, 9 May 2024 12:16:07 +0000 (14:16 +0200)]
make: generate

6 months agotests: vdo conversion updates
Zdenek Kabelac [Thu, 9 May 2024 22:24:23 +0000 (00:24 +0200)]
tests: vdo conversion updates

6 months agocommands: move tabs to eol
Zdenek Kabelac [Thu, 9 May 2024 12:05:24 +0000 (14:05 +0200)]
commands: move tabs to eol

Make the source code a bit easier to read.

6 months agocommands: enable more options for vdo conversion
Zdenek Kabelac [Thu, 9 May 2024 12:15:45 +0000 (14:15 +0200)]
commands: enable more options for vdo conversion

Update definitions to add support for some more VDO options
when converting volumes to be used as thin-pool with vdo data volume.

Split some option in existing OO_LVCONVERT_VDO to OO_LVCONVERT_VDO_POOL
and reused then with OO_LVCONVERT_THINPOOL.

6 months agolvconvert: vdo support conversion options
Zdenek Kabelac [Thu, 9 May 2024 22:26:29 +0000 (00:26 +0200)]
lvconvert: vdo support conversion options

When convert already existing vdopool to be used as
thin-pool backend and user is passinng option for VDO configuration
process them - as we know converted LV is offline, we can do such
change easily instead of telling user to run separate lvchange later.

6 months agolvconvert: vdo control for signature wiping
Zdenek Kabelac [Thu, 9 May 2024 22:25:39 +0000 (00:25 +0200)]
lvconvert: vdo control for signature wiping

When converting volumes to be used for thin-pool with VDO, allow
users to control wipesingature behaviour.
By default volumes should be checked against signature, and if
they are present, we promt user whether he wants to process with
conversion and lose i.e. filesystem present on such volume.

Users that want to bypass prompt in script can use either --yes
or they can disable wipe signature -Wn.

6 months agoman: lvmthin more extend options 1283484574
David Teigland [Wed, 8 May 2024 15:29:22 +0000 (10:29 -0500)]
man: lvmthin more extend options

6 months agotests: runner updates line with last timestamp 1283405129
Zdenek Kabelac [Wed, 8 May 2024 14:02:44 +0000 (16:02 +0200)]
tests: runner updates line with last timestamp

6 months agoclean: use struct initializer
Zdenek Kabelac [Wed, 8 May 2024 12:24:21 +0000 (14:24 +0200)]
clean: use struct initializer

6 months agodmsetup: const string_args array
Zdenek Kabelac [Wed, 8 May 2024 12:35:20 +0000 (14:35 +0200)]
dmsetup: const string_args array

Convert _string_args to const char*.
Do not modify options read from getopt().

6 months agodmsetup: use tab for indent
Zdenek Kabelac [Wed, 8 May 2024 12:19:17 +0000 (14:19 +0200)]
dmsetup: use tab for indent

Use \t for help indention.

6 months agodmsetup: more const strings
Zdenek Kabelac [Wed, 8 May 2024 12:14:27 +0000 (14:14 +0200)]
dmsetup: more const strings

More strings into .rodata segment.

6 months agodmsetup: reduce parser code
Zdenek Kabelac [Wed, 8 May 2024 12:04:12 +0000 (14:04 +0200)]
dmsetup: reduce parser code

Switch set upfront.
Only add code, which is not common for every switch.
Use just 16bit for switch counting.

6 months agolibdm: fix invalid conversion 1282874709
Zdenek Kabelac [Wed, 8 May 2024 07:54:30 +0000 (09:54 +0200)]
libdm: fix invalid conversion

Previous commit missed to also add one to added 'len'.

6 months agolibdm: stats uses overflowing counter
Zdenek Kabelac [Wed, 8 May 2024 07:36:39 +0000 (09:36 +0200)]
libdm: stats uses overflowing counter

Here we need to annotate counter as it starts with UINT64_MAX
and overflows to 0 is expected.

6 months agoclenaup: update local static with _ 1282494242
Zdenek Kabelac [Tue, 7 May 2024 23:15:33 +0000 (01:15 +0200)]
clenaup: update local static with _

6 months agoconst: tests
Zdenek Kabelac [Tue, 7 May 2024 20:06:35 +0000 (22:06 +0200)]
const: tests

6 months agoman-generator: remove unused declarations
Zdenek Kabelac [Mon, 6 May 2024 21:56:47 +0000 (23:56 +0200)]
man-generator: remove unused declarations

6 months agocov: remove dead code
Zdenek Kabelac [Tue, 7 May 2024 13:25:32 +0000 (15:25 +0200)]
cov: remove dead code

6 months agocov: eliminate dead code
Zdenek Kabelac [Tue, 7 May 2024 13:21:19 +0000 (15:21 +0200)]
cov: eliminate dead code

Deduplicate code and also drop some warn about dead code.

6 months agocov: avoid TOCTOU
Zdenek Kabelac [Tue, 7 May 2024 12:48:55 +0000 (14:48 +0200)]
cov: avoid TOCTOU

Use just opendir() call and produce error message from errno state.

6 months agocov: enum mapping cache format
Zdenek Kabelac [Tue, 7 May 2024 15:19:55 +0000 (17:19 +0200)]
cov: enum mapping cache format

Cleanly map cache metadata format enumeration.

6 months agocov: enum health status
Zdenek Kabelac [Tue, 7 May 2024 14:33:03 +0000 (16:33 +0200)]
cov: enum health status

Cleanly map health char status to enum.

6 months agocov: enum matching type
Zdenek Kabelac [Tue, 7 May 2024 14:27:08 +0000 (16:27 +0200)]
cov: enum matching type

6 months agocov: enum correct prototype
Zdenek Kabelac [Tue, 7 May 2024 11:58:21 +0000 (13:58 +0200)]
cov: enum correct prototype

Cleanup enum usage.

6 months agocov: cast to matching prototype
Zdenek Kabelac [Tue, 7 May 2024 11:38:10 +0000 (13:38 +0200)]
cov: cast to matching prototype

Match function prototype with casting.

6 months agocov: check for overlow math
Zdenek Kabelac [Tue, 7 May 2024 11:24:01 +0000 (13:24 +0200)]
cov: check for overlow math

Add some extre protection to avoid integer overflow type of problems.

6 months agocov: annotate to silent some coverity warning
Zdenek Kabelac [Mon, 6 May 2024 21:59:59 +0000 (23:59 +0200)]
cov: annotate to silent some coverity warning

6 months agocov: use literal for printf
Zdenek Kabelac [Mon, 6 May 2024 20:46:09 +0000 (22:46 +0200)]
cov: use literal for printf

Use literal for printf and just empty string if needed.

6 months agocov: use literal for printf format
Zdenek Kabelac [Mon, 6 May 2024 20:41:58 +0000 (22:41 +0200)]
cov: use literal for printf format

Prepare suffix ahead and use literal for printf().

6 months agocov: sanitize input buffer
Zdenek Kabelac [Tue, 7 May 2024 22:00:28 +0000 (00:00 +0200)]
cov: sanitize input buffer

Make coverity aware the input line is legit.
Eventually add more sanitize functionality.

6 months agocov: sanitize string for file path
Zdenek Kabelac [Mon, 6 May 2024 20:26:31 +0000 (22:26 +0200)]
cov: sanitize string for file path

6 months agocov: wrap pvck call
Zdenek Kabelac [Sat, 4 May 2024 21:07:45 +0000 (23:07 +0200)]
cov: wrap pvck call

Resolve reported leak by renaming existing pckk() to pvck_mf()
and wrapping pvck() over this. This function can easily
free allocated buffer within the subfunction.

6 months agocov: strcpy mempcy
Zdenek Kabelac [Sat, 4 May 2024 20:31:21 +0000 (22:31 +0200)]
cov: strcpy mempcy

6 months agocov: replace strcat with safe snprintf
Zdenek Kabelac [Sat, 4 May 2024 20:00:51 +0000 (22:00 +0200)]
cov: replace strcat with safe snprintf

6 months agocov: replace strcpy with memcpy
Zdenek Kabelac [Sat, 4 May 2024 19:56:34 +0000 (21:56 +0200)]
cov: replace strcpy with memcpy

6 months agocov: use sscanf buffer size limits
Zdenek Kabelac [Sat, 4 May 2024 19:14:41 +0000 (21:14 +0200)]
cov: use sscanf buffer size limits

String parsing with buffer size limit.

6 months agocov: check for valid raid0 LV segment
Zdenek Kabelac [Sat, 4 May 2024 10:38:13 +0000 (12:38 +0200)]
cov: check for valid raid0 LV segment

Add internal error to quiet Coverity fear of NULL pointer deref.

6 months agoraid: easier prompt message
Zdenek Kabelac [Sat, 4 May 2024 18:30:10 +0000 (20:30 +0200)]
raid: easier prompt message

Use  printf capability of 'prompt()' funtions so use literal
when building this message.

6 months agolvmlockd-dlm: log_error message with literal
Zdenek Kabelac [Sat, 4 May 2024 10:25:36 +0000 (12:25 +0200)]
lvmlockd-dlm: log_error message with literal

Use literals for printf() message construction.

6 months agolibdm: unlink checks for ENOENT
Zdenek Kabelac [Tue, 7 May 2024 20:34:17 +0000 (22:34 +0200)]
libdm: unlink checks for ENOENT

6 months agolibdm: use literal for error message
Zdenek Kabelac [Sat, 4 May 2024 09:30:50 +0000 (11:30 +0200)]
libdm: use literal for error message

Use literals for printf messages.

6 months agoconst: daemon server logging backend struct
Zdenek Kabelac [Tue, 7 May 2024 18:41:40 +0000 (20:41 +0200)]
const: daemon server logging backend struct

6 months agoconst: lvmpolld long_options
Zdenek Kabelac [Tue, 7 May 2024 14:55:24 +0000 (16:55 +0200)]
const: lvmpolld long_options

Rework usage of long_options so it can be constified,
and also correct use of 'enum action_index'.

6 months agoconst: rework conversion to enum
Zdenek Kabelac [Sat, 4 May 2024 09:25:58 +0000 (11:25 +0200)]
const: rework conversion to enum

Easier code with string and also avoids mixing enums.

6 months agoconst: array of const values
Zdenek Kabelac [Sat, 4 May 2024 09:17:29 +0000 (11:17 +0200)]
const: array of const values

6 months agoconst: libdm err_fmt as string
Zdenek Kabelac [Sat, 4 May 2024 09:10:10 +0000 (11:10 +0200)]
const: libdm err_fmt as string

6 months agoman: lvmthin update 1280524941
David Teigland [Mon, 6 May 2024 17:01:52 +0000 (12:01 -0500)]
man: lvmthin update

major refresh of text and organization

6 months agodmsetup: fix invalid loop test 1278127232
Zdenek Kabelac [Fri, 3 May 2024 23:53:54 +0000 (01:53 +0200)]
dmsetup: fix invalid loop test

Last patcheds had incorrect merging bug - fix loop test.

6 months agoRevert "libdm: fix condition" 1278121961
Zdenek Kabelac [Fri, 3 May 2024 23:37:51 +0000 (01:37 +0200)]
Revert "libdm: fix condition"

This reverts commit 2a1e200f7af3d4c52afbb4627c8cf87f98baa71e.

Breaks some test - more analysis is needed.

6 months agoWHATS_NEW: update 1278107058
Zdenek Kabelac [Fri, 3 May 2024 22:49:51 +0000 (00:49 +0200)]
WHATS_NEW: update

6 months agomake: generate
Zdenek Kabelac [Fri, 3 May 2024 22:47:06 +0000 (00:47 +0200)]
make: generate

Update for --wipesignatures for lvconvert.

6 months agodmsetup: use getopt defines
Zdenek Kabelac [Fri, 3 May 2024 20:44:06 +0000 (22:44 +0200)]
dmsetup: use getopt defines

Replace 0/1 with getopts defines no/required_argument

6 months agoconst: dmsetup long_options
Zdenek Kabelac [Fri, 3 May 2024 19:28:34 +0000 (21:28 +0200)]
const: dmsetup long_options

6 months agoconst: dmsetup string
Zdenek Kabelac [Fri, 3 May 2024 15:12:23 +0000 (17:12 +0200)]
const: dmsetup string

6 months agoconst: cmirrord array
Zdenek Kabelac [Fri, 3 May 2024 18:24:29 +0000 (20:24 +0200)]
const: cmirrord array

6 months agoconst: lvmlockctl options
Zdenek Kabelac [Fri, 3 May 2024 18:17:39 +0000 (20:17 +0200)]
const: lvmlockctl options

6 months agoconst: dmfilemapd strings
Zdenek Kabelac [Fri, 3 May 2024 15:36:18 +0000 (17:36 +0200)]
const: dmfilemapd strings

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