1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-07-14 16:58:59 +03:00

20126 Commits

Author SHA1 Message Date
7b383df03e test: aux add more ignored dirs 2025-07-14 02:29:49 +02:00
31cea1bbdc test: fix skipping of this repair test
Fix the usage of delay_dev so the test is properly executed
and not skiped. For major mirror slowdown use smalled region
sizes that are cause way more frequent commits so we can go
with significantly smaller delays.

Also check repair to work for failing mirror leg and mirror log.
2025-07-14 02:29:49 +02:00
e4ef309d62 test: update for upper case warning
As WARNING consistency patch slighly change some reported messages,
update some tests (and use  'grep -i').
2025-07-14 02:29:49 +02:00
4cf9077899 test: use same device match for btrfs testing
Copy the btrfs device matching from lvresize helper script.
2025-07-14 02:29:49 +02:00
2539aadb50 lvresize: use major:minor to compare btrfs device
What we really do want to compare is devnode the device
name is actually using - this is uniq match.
2025-07-14 02:29:49 +02:00
584d6aff95 WHATS_NEW: update 2025-07-13 20:55:43 +02:00
04d75d7a63 make: generate 2025-07-13 20:55:43 +02:00
6cb61996b6 configure: update autotools 2025-07-13 20:55:43 +02:00
527b54cb17 test: refactor lvconvert-raid-reshape-size.sh
Improve the RAID reshape size test script with the following changes:

**Code Quality Improvements:**
- Add proper shell quoting throughout the script to prevent word splitting issues
- Replace manual arithmetic with cleaner shell arithmetic syntax
- Improve variable handling and remove unnecessary local variable assignments
- Fix typo: "hilesystem" -> "filesystem"

**Test Reliability Enhancements:**
- Add EXTENSIVE_FSCK environment variable for optional additional filesystem validation
- Reduce delay times from 40ms/25ms to 20ms for all RAID types to speed up testing
- Add helper functions _delay_dev() and _restore_dev() for cleaner device delay management
- Use --noudevsync flag in lvconvert to avoid udev-related timing issues
- Remove unnecessary sleep calls and udevadm settle commands

**Functionality Improvements:**
- Improve _check_size() function to return proper exit codes instead of echo statements
- Better error handling in conditional statements using proper test syntax
- Cleaner parameter passing using "$@" instead of manual argument handling
- More robust device path handling using $DM_DEV_DIR consistently

**Code Structure:**
- Extract device delay logic into reusable helper functions
- Improve readability with better variable naming and consistent formatting
- Add explanatory comments for complex operations
2025-07-13 20:55:43 +02:00
cbd1918dce test: lvconvert-raid-reshape-size.sh return from _check_size 2025-07-13 20:55:43 +02:00
c53c895612 test: lvconvert-raid-reshape-size.sh only create PVs+VG once
Saves a few seconds in test run.
Add --noudevsync to save big time.
2025-07-13 20:55:43 +02:00
07bc54f333 test: lvconvert-raid-reshape-size.sh fix test bug 2nd
Up'ed millisecnd delays.
Undelayed earlier.
Only delaying rimage allocations, not lvm2 mda or rmeta ones.
2025-07-13 20:55:43 +02:00
eb13823985 test: lvconvert-raid-reshape-size.sh fix test bug further
_check_size_timeout function added compensating the block layer bdev update race
thus avoiding other explicit sleeps spread in the test code.
"udevadm settle" approach gone.
No --noudevsync mandatory.
2025-07-13 20:55:43 +02:00
312b29ecfe test: lvconvert-raid-reshape-size.sh fix test bug
Size check for stripe size reshape was bogus.

Whilst on it, optimize delay on test device to
avoid delying LVM2 MDA and RAID rmeta SubLV.

Also update some comments.
2025-07-13 20:55:43 +02:00
c5084b4ba5 test: update lvresize-btrfs.sh
Slightlty better integration with test suite.
Use $lv1, $lv2, $lv3.
Use properly "" around string (shellcheck).
2025-07-13 20:55:43 +02:00
e76eba860f test: drop unused variable
Remove unused max_log_count.
Update some skip messages.
2025-07-13 20:55:43 +02:00
d2a66d4343 test: use proper if-then-fi sequence
Adapting the test for the changed behavior of lvconvert
where the mirror leg and log count is not changing.

Properly test for this condition - checking only leg count is
not enough to expect error return code.

And finaly fixing invalid bash scripting logic since:

test && TRUE || FALSE

is not bash equivalent of:

if test ; then
   TRUE
else
   FALSE
fi
2025-07-13 20:55:43 +02:00
bdfdc52093 debug: log_warn sentence begins with capital
Improve the consistency and readability of warning messages.
Capitalize the first word of all warning messages.
Add periods at the end of warning messages.

The changes are purely cosmetic and do not affect functionality.
2025-07-13 20:55:43 +02:00
296fcd4c79 man: fix some typos and grammar issues
Drop misplaced letter 'I'.
Missing articles (a, an, the)
Incorrect prepositions (in/into, to/in)
Subject-verb agreement errors.
Awkward phrasing that needs smoothing.
Fixed prepositions ("prior to" instead of "prior the")
Corrected subject-verb agreement ("are becoming" instead of "is becoming")
Fixed word choices ("represents" instead of "presents")
Used consistent terminology ("environment" instead of "environmental")
Fixed pronoun references ("them" instead of "it" when referring to plural subjects)

Originated-by: warp-terminal
2025-07-13 20:55:43 +02:00
cfeeee9b3d cleanup: a/an fixups
Some a/an fixups along with a couple more odds and ends.
Hopefully this is useful like this as plain diff output
or let me know if something else will work better.
2025-07-13 20:55:43 +02:00
a23ef8e26f gcc: ensure pointer is properly initialized
Fix gcc warning by ensuring pointers are properly defined and
initialized before use in man-generator code to prevent potential
undefined behavior.
2025-07-13 20:55:43 +02:00
ca844f7715 cov: replace unsafe string sscanf
Althouh here we were copying to the properly allocated space
let's just replace it with this copy code.
2025-07-13 20:55:43 +02:00
61159f127a cov: reduce strcpy
Copy fix we already have device_mapper through commit:
7bc5c8ac3d
2025-07-13 20:55:43 +02:00
274e09755c cov: remove unused header
Remove unused header file.
Warp also identified duplicated header file inclusion.
2025-07-13 20:55:43 +02:00
c6b924c843 cov: remove unused variables
Remove unused variables identified by coverity analysis to clean up
code and eliminate static analysis warnings.
2025-07-13 20:55:43 +02:00
8be572d4f4 cov: reduce printf format string parameters
Simplify printf format strings by removing unnecessary parameters
in libdm-report and toollib components to resolve coverity warnings
about format string mismatches.
2025-07-13 20:55:43 +02:00
3e811e5f85 cov: use proper enum value for bitmask operation
Fix coverity warning by using the correct enum value instead of
a raw integer for bitmask operations in activation code.
2025-07-13 20:55:43 +02:00
e1e35840f3 cov: suppress false positive warnings
Add coverity annotations to suppress false positive warnings for
unimportant results across multiple files including dmeventd,
lvmlockd, display, logging, dmsetup, and man-generator components.
2025-07-13 20:55:43 +02:00
0695846dcc glibc: switch to standard endian conversion macros
Replace all uses of Linux kernel-style endian conversion macros/functions
(e.g., le32_to_cpu, cpu_to_le32, xlate32, xlate64, etc.) with the standard
POSIX/glibc macros (e.g., le32toh, htole32, htobe32, be32toh, etc.) from
<endian.h>.

- Update all code to use le16toh, le32toh, le64toh, htole16, htole32, htole64,
  htobe16, htobe32, htobe64, be16toh, be32toh, be64toh as appropriate.
- Provide fallback macro definitions in xlate.h for systems lacking these
  standard macros, ensuring backward compatibility with older glibc and non-glibc
  systems.
- Remove or replace all project-specific xlateXX and cpu_to_leXX/cpu_to_beXX
  macros.
- No functional change intended; this is a mechanical, treewide modernization
  for clarity, portability, and future maintainability.
2025-07-13 20:55:43 +02:00
ed63b90441 cov: add explicit enum casts to fix type warnings
Add explicit casts to enum types in dmeventd and libdevmapper-event
to resolve coverity warnings about implicit type conversions.
2025-07-13 20:55:43 +02:00
96b0f1a178 lvresize: update code to get btrfs devid
Let's try different mechanism to obtain devid when
resizing btrfs filesystem spread across multiple volumes.

Using patch from https://github.com/lvmteam/lvm2/issues/180

Originated-by:  Damenly Su <l@damenly.org>
2025-07-13 20:55:43 +02:00
1593a6e47c lvconvert: error mirror LV non-changing request
To have the very same matching logic to raid1 commit:
c901528053
we add similar check for mirror where we check if mirror leg and
log count is not changing which will now return also an error.
2025-07-13 17:20:43 +02:00
5d16b1d734 tools: simplify LVM_DID_EXEC environment variable
Set LVM_DID_EXEC to "1" instead of using the command name string,
avoiding potential issues with unusual command names and improving
consistency in environment variable handling.
2025-07-13 17:18:56 +02:00
adb8ca503b tools: add arg_force_value() for enum handling
Add arg_force_value() function that returns the correct force_t enum
type, replacing direct string comparisons. Update lvconvert and
pvremove to use this new function for better type safety.

This is cleaner solution over just plain cast to force_t as we can
validate force level in use.
2025-07-13 17:18:56 +02:00
a68cfa5691 command: replace manual binary search with bsearch
Replace custom binary search implementation with the standard library's
bsearch() function for better maintainability.
Also convert command_name from pointer to char array and simplify name
ordering validation logic.
2025-07-13 17:18:56 +02:00
7c79abc33f command: fix alignment in help output formatting
Fix inconsistent spacing in command help output by introducing
_print_opt_with_align() function that properly handles alignment
for options with and without short forms. This resolves the extra
spaces that were being printed in --longhelp output.

Fixes regression introduced in commit:
491c6652ae.
2025-07-13 17:18:56 +02:00
0b7b6ccd79 command-lines: fix typo in configurable name
Fix type in lvm.conf option name used for lvcreate
and replace global/mirror_segfault_default with correct
name global/mirror_segtype_default.
2025-07-13 17:18:56 +02:00
f82c46e673 sanlock: fix file descriptor leak in error path
Add proper cleanup of file descriptor in the error handling path
to prevent resource leaks when sanlock operations fail.
2025-07-13 17:16:20 +02:00
b86b1da80a sanlock: fix struct copy to avoid aliasing issues
Replace direct structure assignment with explicit copying to prevent
potential undefined behavior from structure aliasing. This ensures
proper memory handling when working with sanlock structures.

This possibly fixes regression introduced with commit: e9640e5178
as unintended side effect.
2025-07-13 17:16:20 +02:00
bd26e768ef udev: fix autoactivation on top of loop dev PVs
We already check loop devices for LVM_LOOP_PV_ACTIVATED="1" in udev
rules to see if have executed pvscan before. If that is the case, we
don't want to execute it again to avoid VG reactivation.

However, the rules missed the IMPORT{db}="LVM_LOOP_PV_ACTIVATED" rule
to actually get the value already stored in udev db from previous event.
As a result, the pvscan executed on each CHANGE udev event, hence the
VG autoactivation triggered each time as well.

Fix this by adding the missing IMPORT{db}="LVM_LOOP_PV_ACTIVATED" rule
(just like we already do for MD devices).

Note: Keep the behavior for ADD events. That is, we still want the
autoactivation to trigger each time, otherwise coldplug will not work
(again, we have the same principle used for MD devices).
2025-07-09 12:48:48 +02:00
8e2cdcc006 test: adjust lvconvert-mirror-basic.sh to now erroring non-changing image mirror request
See commit c901528053
2025-07-02 14:05:18 +02:00
a2c9e252a0 sanlock: add function only for newer SANLOCK
Avoid adding unused static function with older SANLOCK.
2025-07-02 11:51:20 +02:00
95c77bc922 sanlock: match lm_lock_sanlock prototype 2025-07-02 11:51:20 +02:00
3358e0339a lvmlockd-sanlock: remove info file when vg is removed 2025-07-01 13:36:23 -05:00
f35f074afd lvmlockd-sanlock: check lock_lv_offset_from_args result 2025-07-01 11:23:16 -05:00
78e087f54c lvmlockd: check adopt file fflush and fclose 2025-07-01 11:17:06 -05:00
e16439b8aa lvmlockd: check sscanf results when reading file values 2025-07-01 11:11:59 -05:00
fcca60fda6 lvmlockd: free structs in adopt error path 2025-07-01 10:53:33 -05:00
592cd62de3 lvmlockd-sanlock: fix size in dm_snprintf 2025-07-01 10:29:11 -05:00
1eaada302b lvmlockd-sanlock: fix uninitialized time value 2025-07-01 10:29:11 -05:00