Zdenek Kabelac
74e487f3a9
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.
2024-05-13 02:21:37 +02:00
Zdenek Kabelac
8da0ab6fc1
cleanup: drop unused declared struct
2024-05-13 02:21:37 +02:00
Zdenek Kabelac
8168b5e71d
clenaup: update local static with _
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
09f70dbb87
cov: avoid TOCTOU
...
Use just opendir() call and produce error message from errno state.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
5f1c799e6a
cov: enum mapping cache format
...
Cleanly map cache metadata format enumeration.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
5818fbfbcf
cov: enum matching type
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
3e91823b3e
cov: enum correct prototype
...
Cleanup enum usage.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
3f41b4af55
cov: check for overlow math
...
Add some extre protection to avoid integer overflow type of problems.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
5c7d6083a9
cov: annotate to silent some coverity warning
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
bbf352892d
cov: use literal for printf
...
Use literal for printf and just empty string if needed.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
d7c2fe9723
cov: use literal for printf format
...
Prepare suffix ahead and use literal for printf().
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
9f4dc4170b
cov: sanitize string for file path
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
db40a2e33c
cov: replace strcat with safe snprintf
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
04b407674c
cov: use sscanf buffer size limits
...
String parsing with buffer size limit.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
61a11f25a3
cov: check for valid raid0 LV segment
...
Add internal error to quiet Coverity fear of NULL pointer deref.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
099a4e2146
raid: easier prompt message
...
Use printf capability of 'prompt()' funtions so use literal
when building this message.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
7f25e58f66
const: array for _vdo_split
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
8bbd00162b
const: log level string
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
eae0314b55
const: suffixes list
...
dm_tree_set_optional_uuid_suffixes() is safe to use with overcasted
array to (const char**)
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
0e5250c475
const: _reserved
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
e6f46fafe7
const: use arrays of strings 2
...
Next set of changes.
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
0bcf2c6514
const: use arrays of strings
...
Such string is stored directly in '.rodata' section.
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
efe2005022
const: drop static keyword
...
We don't need relocatable space to store 'const' number.
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
abf7c40185
const: static array
...
Such array can be stored in .rodata section.
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
acabc995c0
const: config items
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
9f506eb89e
const: raid takover arrays
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
6430a6ca63
const: _fns poll_function
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
ff699eab24
const: _ops text_vg_version
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
41ffa8c74d
const: _ops labeler _text_ops
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
64cb8b5940
const: _ops segtype handler
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
effafa8fc8
const: _ops text handler
...
Making sure these structures ends in '.data.rel.ro' section.
(instead of plain '.data' section).
2024-05-04 01:01:42 +02:00
Zdenek Kabelac
a6f4aed3c0
vdo: enhance error path
...
When the conversion to VDO fails, try to restore previous VG state
and also remove orphan DM node from table.
2024-05-04 00:57:14 +02:00
Zdenek Kabelac
6f8abdc978
cleanup: tab indent and typo
2024-05-02 11:58:26 +02:00
Zdenek Kabelac
db6bb6e90b
cleanup: unlink passes with ENOENT
2024-05-01 10:55:17 +02:00
Zdenek Kabelac
061fa7b690
cleanup: remove unused code
2024-05-01 10:55:17 +02:00
Zdenek Kabelac
2a39ed7741
writecache: reuse some API
...
Tiny code updates, reuse dm_pool_strdup().
2024-05-01 10:55:17 +02:00
Zdenek Kabelac
b8d5c4b41a
memory: compile with VALGRIND_POOL
...
Function to _allocate_memory() was not compiled-in when lvm2 was
build with support for better tracking memory pool with valgrind.
Instead now correctly avoid this function only when running
withing valgrind environment.
2024-05-01 10:54:54 +02:00
Zdenek Kabelac
d5da7604e5
memory: convert log_error
...
As the memory locking is not causing command's error - convert
error messages to warnings and debugs.
2024-05-01 10:54:54 +02:00
Zdenek Kabelac
7ec0f69cd1
toolcontext: introduce var for run in valgrind
2024-05-01 10:54:34 +02:00
Zdenek Kabelac
9162ae0a0a
activation: interruptible sleep when talking to dmeventd
2024-05-01 10:54:34 +02:00
Zdenek Kabelac
d2f953c9db
command: use const declaration for arrays
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
ecabdf68cf
lvconvert: use cmd_context variable
...
Do not modify flags field from 'strcut command_name' and
instead control this via cmd_context get_vgname_from_options.
Flag GET_VGNAME_FROM_OPTIONS is currently used only by lvconvert.
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
3fc34ac7ee
vdo: fix setting VDO size when stacked
...
When VDO is used as data LV for thin-pool, we need
to use correct function to propagate this through
the stack of volumes.
2024-04-26 21:37:51 +02:00
David Teigland
21b683614c
lvmcache: stop saving duplicate pvs info between scans
...
In the past it was common for a single command to run
multiple lvmcache_label_scan, and this code was a way
to make each call select the same duplicate pvs. Now
commands run a single lvmcache_label_scan, so this is
not needed.
2024-04-26 14:13:46 -05:00
Zdenek Kabelac
c6a37ddca4
toolcontext: check runtime valgrind
...
When reseting stream buffer - check for being run within valgrind
and only in this case skip this code.
Define VALGRIND_POOL was incorrectly used for this logic.
2024-04-25 21:26:01 +02:00
Zdenek Kabelac
ecb8399005
lvm: use configure proc dir in lvm.conf
...
Update some code parts to use configurer /proc from lvm.conf
(so i.e. our testing can use some fake values)
2024-04-15 13:38:44 +02:00
Zdenek Kabelac
84b084c9b6
configure.ac: define DEFAULT_PROC_DIR in one place
...
Let's move proc into include/configure.h so this define can
be easily used across the source base.
Configure defines it - but ATM we do not provide any configure
option to change it - there should be no need to ever change it.
2024-04-15 13:38:44 +02:00
David Teigland
f59ec61fa7
lvmcache: fix memleaks on list removal
...
Free members released from the list.
2024-04-15 12:58:27 +02:00
Zdenek Kabelac
8d1a946a9b
tests: update unit-tests
...
Fix some memleaks.
Drop call of bcache_clear_fd() when bache was not initialized.
2024-04-10 00:04:54 +02:00
Zdenek Kabelac
c5b4574729
cov: use stream ptr in its original form
...
Let's stop Coverity thinking here we are using freed FILE*
for anything else then comparing numbers.
For this use the original source of old_stream pointer.
2024-04-10 00:03:09 +02:00