Zdenek Kabelac
5c0ade35e2
util: swap header file load order
...
Ensure libdevmapper is included before util.h since
we are going to add function that is using it.
TODO: maybe add include directly here...
2024-04-04 19:33:58 +02:00
Zdenek Kabelac
fa81c7561f
cov: missing initializer
...
Ensure there is no code path with uninitialized takes_arg.
2024-04-04 19:33:58 +02:00
David Teigland
c78970c0d0
lvmcache: free list of add_cache_devs
2024-04-03 15:59:25 -05:00
David Teigland
6d6e8d69eb
lvmdevices: fix memleak of use_old du
...
missed in the the prev done_old commit
2024-04-03 15:29:17 -05:00
Zdenek Kabelac
fb80ed3143
cleanup: remove lvmcache_has_bad_metadata
2024-03-30 00:17:39 +01:00
Zdenek Kabelac
adfa16c899
cleanup: drop unused code
2024-03-30 00:17:39 +01:00
Zdenek Kabelac
d39b47d665
filtes: remove lvmetad bits from usable filter
...
Eliminate some dead code from usable filter, that is no longer usable
after removal of lvmetad.
2024-03-30 00:17:39 +01:00
Zdenek Kabelac
46ef562c50
device_id: simplier loop control
2024-03-30 00:17:39 +01:00
Zdenek Kabelac
d65a428f2d
device_id: use dm_strncpy
...
Simplify code.
2024-03-30 00:17:39 +01:00
Zdenek Kabelac
b8d5744c6e
deviced_id: use zalloc
...
While moving to dm_strncpy, in this case since pvid is also
passed to crc calc, make sure whole buffer is always initilized.
2024-03-30 00:17:39 +01:00
Zdenek Kabelac
4151df32c1
filter: zero internal structure
...
Valgrind noticed access to unitialized warned_filter.
2024-03-30 00:17:39 +01:00
Zdenek Kabelac
6172db5326
lvmdevices: fix memleak of done_old du
...
'done_old' list missed released.
2024-03-30 00:17:07 +01:00
Zdenek Kabelac
eba277bca8
cov: cast to uint32
2024-03-29 01:36:48 +01:00
Zdenek Kabelac
a98709aeae
cov: validate count is bigger then 0
...
To avoid teoretical underflow...
2024-03-29 01:36:48 +01:00
Zdenek Kabelac
466265eaa6
tests: better constructor
2024-03-29 01:36:48 +01:00
Zdenek Kabelac
ee496f2846
cov: validate major and minor
...
Check major and minor is >= 0.
2024-03-29 01:36:48 +01:00
Zdenek Kabelac
93a633092a
cov: store 64b flags
...
Alhtough no target is currently using that many bits for their flags,
preserve the size for loaded segment internally.
2024-03-29 01:36:48 +01:00
Zdenek Kabelac
960df88621
cov: validate i before underflow
...
Although it can't happen in this code, ensure 'i' is not 0
before decrementing it.
2024-03-29 01:34:22 +01:00
Zdenek Kabelac
fef49a0e86
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...
2024-03-29 01:34:22 +01:00
Zdenek Kabelac
fe2294769c
cov: use dm_strncpy
...
Use better variant.
2024-03-28 22:19:45 +01:00
Zdenek Kabelac
2b7d0db7f1
cov: no overwrite of const qualified fields
2024-03-28 22:19:14 +01:00
Zdenek Kabelac
7ec7d8cf54
cov: reset FILE on error path
...
Although fclose() fails - we should not be retrying with
already released stucture.
2024-03-28 21:15:38 +01:00
Tony Asleson
59b46fc8cd
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.
2024-03-28 18:18:37 +01:00
Tony Asleson
f2edc96bb6
tests: lvmdbustest.py skip if g_tmo != 0
...
This test doesn't have any additional value when running when g_tmo != 0.
2024-03-28 18:18:37 +01:00
Tony Asleson
3430395c85
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.
2024-03-28 18:18:37 +01:00
Zdenek Kabelac
fc477192e5
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.
2024-03-28 18:18:37 +01:00
Zdenek Kabelac
4ba683bb18
debug: update some structure members
...
Makes pahole output look slightly better.
2024-03-28 18:18:37 +01:00
Zdenek Kabelac
f1e80f3be0
commands: reduce command structure size more
...
Check for internal limits, if they would ever need to be raised report
error message and fail parsing.
2024-03-28 18:18:37 +01:00
Zdenek Kabelac
8965fd18aa
cov: ensure buffer always ends with nul
...
When we print anything out of buffer, ensure there is \0.
2024-03-28 18:18:37 +01:00
Zdenek Kabelac
1d150d63c7
cov: ensure nul ends string
2024-03-28 18:18:37 +01:00
Zdenek Kabelac
69f9fcfd20
tests: skip some mirror tests for polld and lockd
...
Leave just lvconvert-mirror-basic-1 test
for polld and lockd testing.
2024-03-27 01:26:57 +01:00
Zdenek Kabelac
4a69bacc20
gcc: use uint16_t for counters
2024-03-27 01:11:00 +01:00
Zdenek Kabelac
83b726e5dd
gcc: move declaration into ifdef
...
Prevent unused warning when the ifdef code is not compiled.
2024-03-27 01:11:00 +01:00
Zdenek Kabelac
0dbd90d74e
gcc: match signed integers
2024-03-27 01:11:00 +01:00
Zdenek Kabelac
2b864aeb14
configure: lcov needs -fprofile-update=atomic
...
To avoid negative counters.
See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68080
2024-03-27 01:11:00 +01:00
Zdenek Kabelac
f98d2ffe87
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>
2024-03-27 00:30:58 +01:00
Zdenek Kabelac
8c4b8c6e27
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.
2024-03-26 15:58:36 +01:00
Zdenek Kabelac
1c2dff2655
tests: missed reduction of raid check
2024-03-25 17:17:40 +01:00
Zdenek Kabelac
c4b1bfa5f0
cov: use proper enum value
2024-03-25 17:17:24 +01:00
Zdenek Kabelac
421afd287a
cov: ensure namelist is defined
...
Seems coverity doesn't have good model for scandir.
Let's ensure pointer is seen as defined.
2024-03-25 17:16:00 +01:00
Zdenek Kabelac
4abdc5981a
cov: validate return from display_lvname
...
Ensure strdup will not get NULL.
2024-03-25 16:59:27 +01:00
Zdenek Kabelac
4f1d89d37f
cov: validate origin pointer
...
Add internal error for NULL origin here.
2024-03-25 16:57:53 +01:00
Zdenek Kabelac
ac90ab7736
cov: drop some unneeded continue
2024-03-25 16:54:11 +01:00
Zdenek Kabelac
ae7b59f509
cov: check for syscall resuls
2024-03-25 16:38:52 +01:00
Zdenek Kabelac
b84702349f
cov: ensure buffer is nul ended
...
Use dm_strncpy() to ensure ending nul.
2024-03-25 16:37:04 +01:00
Zdenek Kabelac
7e5e98e4f2
tests: fix improper merge within last update
2024-03-25 15:01:48 +01:00
Zdenek Kabelac
05993fd432
makefiles: ignore negative errors for lcov
2024-03-25 14:46:23 +01:00
Zdenek Kabelac
75e532417e
tests: check for raid shrink support
...
Shrink of raid LVs supported from 1.9
2024-03-25 14:46:02 +01:00
Zdenek Kabelac
8716d8c188
cov: check for to_dlm_mode return value
...
Avoid processing invalid to_dlm_mode in lm_convert_dlm.
2024-03-25 14:45:09 +01:00
Zdenek Kabelac
46e013988f
cov: check for strftime result
2024-03-25 14:45:09 +01:00