1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

19062 Commits

Author SHA1 Message Date
Zdenek Kabelac
04e8f8c93d tests: add sleep
mdadm may eventually be too slow...
2024-04-07 20:47:28 +02:00
Zdenek Kabelac
d6df31fba1 pools: no checking for lv/vgremove deactivation
Thin-pool and cache-pool targets got already quite stable so let's try
to remove checking of pools when using lvremove or vgremove commands.

This skips checking pools when they are going to be removed, but it
also when removing thin volume that was the only user of a thin-pool.
In this case thin-pool will be still there and could be activated
again with another thin volume and thin_check will be executed
in this moment. In this case it can delay discovery of metadata damage.
2024-04-07 20:44:28 +02:00
Zdenek Kabelac
2fdf3b137a thin-pool: avoid reactivation on new thin-pool
Shortens processing of 'lvcreate -L -V -T' command and
avoid deactivation and its activation with thin_check of the empty
created thin-pool that will be used for the new thin volume
made with a single lvcreate command.
2024-04-07 20:38:55 +02:00
Zdenek Kabelac
dbc0105e1a vdo: modprobe dm-vdo for kernels >= 6.9
Modprobe "dm-vdo" with new kernels >= 6.9 and go for
'kvdo' with older Linux kernels.
2024-04-07 20:27:39 +02:00
Zdenek Kabelac
a82b93b298 WHATS_NEW: update 2024-04-05 14:31:54 +02:00
Zdenek Kabelac
7fbd3bac71 tests: skip convertions tests for usptream driver 2024-04-05 14:25:27 +02:00
Zdenek Kabelac
6305db53c1 tests: add correct condition for skip of lvmpolld tests
Check when flavour want to test  lvmlockd & lvmpolld tests and
in for case ignore SKIP_WITH_LVMPOLLD from test script.
2024-04-05 14:14:50 +02:00
Zdenek Kabelac
dda859027c vdo: use stats msg parser for also segment status
Shuffle code to parsing VDO message also for lvs segment status
so it can report correctly data usage for VDO LVs.

For this change move code and also change its API to use just mempool.

Fixes usage with upstream 6.9 vdo target driver.
2024-04-05 14:14:50 +02:00
Zdenek Kabelac
203c8b3997 vdo: fix status message parsing
When using message API for parsing VDO stats info, 0 was wrongly
used for fallback for trying the old sysfs API.

Switch to use  ULLONG_MAX for values that could not have been obtained
through the message call.

Fixes lvdisplay info for freshly created VDO volume with 0 used data
blocks.
2024-04-05 13:09:10 +02:00
Zdenek Kabelac
000f55a1a2 tests: updated check for dm-vdo module
With new kernels dm-vdo is now correct name,
so use standard loading and just try extra for kvdo.
2024-04-04 19:38:21 +02:00
Zdenek Kabelac
ecacb2b544 tests: inittest fix skipping condition 2024-04-04 19:38:21 +02:00
Zdenek Kabelac
50b188eebd dev_manager: improve readability
Make a seperate function to decode which ID should be user
for cvol meta or data volume - also avoids duplication of code.
As a result it's now also easier to see how the lvid is build.
2024-04-04 19:38:21 +02:00
Zdenek Kabelac
41f13b2a3b device_id: add comment for trim 2024-04-04 19:38:21 +02:00
Zdenek Kabelac
5dec664ccf lvmlocks: rework dm_strncpy
Fix cutting away 1 character via incorrect usage of dm_strncpy
introduced in last batch of commits and use sizeof(buffer) to
get proper sizes.

In case of use strcpy_name_len() the replacement was invalid,
so we need to restore this case since sanlock uses buffer without
nul ending, so we would strip one more character from the buffer.

Also start to use dm_strncpy() without (void) for unchecked usage.
2024-04-04 19:38:21 +02:00
Zdenek Kabelac
f9fefaaabe refactor: update dm_strncpy to _dm_strncpy
For checked versions of dm_strncpy use inline wrapper _dm_strncpy.
2024-04-04 19:38:21 +02:00
Zdenek Kabelac
995ff58903 refactor: remove (void) from dm_strncpy usage
Start to use dm_strncpy() as unchecked version within source tree.
2024-04-04 19:38:21 +02:00
Zdenek Kabelac
295e632e81 util: add _dm_strncpy
Add internal inline function wrapper for dm_strncpy().
Use it for calls where we test the result.
Avoids emitting warnings in Coverity for unchecked usage.
2024-04-04 19:37:13 +02:00
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