lvm2.git
8 months agomake: generate 1720129941
Zdenek Kabelac [Mon, 17 Mar 2025 12:52:03 +0000 (13:52 +0100)]
make: generate

8 months agoWHATS_NEW: updates
Zdenek Kabelac [Sun, 16 Mar 2025 12:21:58 +0000 (13:21 +0100)]
WHATS_NEW: updates

8 months agoman: indent with command
Zdenek Kabelac [Mon, 3 Mar 2025 17:59:32 +0000 (18:59 +0100)]
man: indent with command

Avoid spaces showing as the 1st. character on the man page line.
Also start with actual text and move .IP sequence to the line end.

8 months agomakefile: rebuild man when see_also changes
Zdenek Kabelac [Tue, 4 Mar 2025 23:14:44 +0000 (00:14 +0100)]
makefile: rebuild man when see_also changes

Missed rebuild dependency, when see_also file changes.

8 months agomakefile: cleanup tab
Zdenek Kabelac [Sun, 16 Mar 2025 10:31:57 +0000 (11:31 +0100)]
makefile: cleanup tab

8 months agotests: don't restart lvmdbusd
Zdenek Kabelac [Sun, 16 Mar 2025 12:17:13 +0000 (13:17 +0100)]
tests: don't restart lvmdbusd

Since lvmdbusd execution of lvm2 command was fixed
stop retrying to restart lvmdbuds and abort testig
when it fails.

8 months agolvm: option description only for man generator
Zdenek Kabelac [Sat, 15 Mar 2025 21:08:02 +0000 (22:08 +0100)]
lvm: option description only for man generator

There is no need to include option description text
within command binary itself.

It's only used only for man generating.

8 months agoman: fixes in argument description
Zdenek Kabelac [Tue, 4 Mar 2025 23:36:26 +0000 (00:36 +0100)]
man: fixes in argument description

Describe missed --segments opt for lvdisplay (matches lvs).

Describe lvm-fullreport --all option - show text for lvs,vgs,pvs.

Missed '.' for --separator.

8 months agolvmdbusd: ensure readout on exit
Zdenek Kabelac [Sun, 16 Mar 2025 12:11:54 +0000 (13:11 +0100)]
lvmdbusd: ensure readout on exit

8 months agocache: ensure UUID ends with \0
Zdenek Kabelac [Tue, 11 Mar 2025 10:20:37 +0000 (11:20 +0100)]
cache: ensure UUID ends with \0

Initialization of union is somewhat tricky as it initialize only
the first member + padding, but in our case this does not clear
the whole size of union so explicitly set \0 after 2 'struct id'
and make sure DM uuid is not using random characters from stack.

Also add explicit .id designators (c99).

8 months agometadata: replace pv status WRONG_VG with pv bit field 1703463207
David Teigland [Thu, 6 Mar 2025 16:51:52 +0000 (10:51 -0600)]
metadata: replace pv status WRONG_VG with pv bit field

Avoid any special meaning associated with the status field.

8 months agolvmcache: unpair wrong PV devs and improve duplicate name warnings
David Teigland [Thu, 6 Mar 2025 16:02:29 +0000 (10:02 -0600)]
lvmcache: unpair wrong PV devs and improve duplicate name warnings

After detecting that a VG has wrongly claimed a PV, unpair
the pv->dev setting.  This will cause the usual "missing PV"
message to appear for that VG.  Make this message, and some
others, clearer by using the VGID rather than the VG name
when there are multiple VGs with the same name.

8 months agolvmcache: fix check for no pvid 1701925449
David Teigland [Wed, 5 Mar 2025 22:03:42 +0000 (16:03 -0600)]
lvmcache: fix check for no pvid

8 months agolvmcache: add WRONG_VG PV status flag 1701793897
David Teigland [Wed, 5 Mar 2025 18:08:38 +0000 (12:08 -0600)]
lvmcache: add WRONG_VG PV status flag

_vg_read() calls lvmcache_update_vg_from_read() which detects
that the VG metadata is incorrectly claiming the PV.  Flag this
condition in the PV status as WRONG_VG.  Later, vg_read() can
simply check the WRONG_VG flag rather than repeating the same
PV/VG checks that were already done in lvmcache_update_vg_from_read.

8 months agolvmcache: ignore incorrect PV claim from old metadata
David Teigland [Tue, 4 Mar 2025 20:11:54 +0000 (14:11 -0600)]
lvmcache: ignore incorrect PV claim from old metadata

Outdated VG metadata that appears when an old device is attached
to the system can result in PVs appearing to belong to the
old/wrong VG, and commands are allowed to use (corrupt) the PVs.

- vgcreate old /dev/sda /dev/sdb /dev/sdc
- offline /dev/sda
- vgreduce --removemissing old
- vgremove old
- vgcreate new /dev/sdb /dev/sdc
- online /dev/sda

When sda is reattached, sdb and sdc will appear to be
in VG old again.  An attempt to correct the problem,
e.g. with vgremove old or vgreduce old, would modify
sdb and sdc, removing them from the new VG.

To fix this, check that sdb and sdc contain metadata for
VG old before allowing VG old to claim ownership of them.
With the fix, sdb and sdc are not displayed as part of
VG old, and commands to change VG old will fail as long
as it references incorrect PVs.

To fix VG old (sda), remove the incorrect PVs from VG old
while limiting the command to see only the correct PVs:
vgreduce --removemissing --devices /dev/sda old

8 months agointegrity: round meta size up to minimum one extent 1697298461
David Teigland [Mon, 3 Mar 2025 16:27:04 +0000 (11:27 -0500)]
integrity: round meta size up to minimum one extent

If VG extents are larger than the required integrity metadata size,
use one extent as the size.

8 months agolvmlockd: add helpful error message for vgremove 1697246414
David Teigland [Mon, 3 Mar 2025 16:05:04 +0000 (11:05 -0500)]
lvmlockd: add helpful error message for vgremove

Print a helpful error message when the lockspace is not started.

9 months agopvresize: accept autobackup option 1691921278
David Teigland [Thu, 27 Feb 2025 16:04:47 +0000 (10:04 -0600)]
pvresize: accept autobackup option

9 months agodoc: Update metadata on 2.03.31 release notes 1691896701
Marian Csontos [Thu, 27 Feb 2025 15:53:55 +0000 (16:53 +0100)]
doc: Update metadata on 2.03.31 release notes

9 months agopost-release
Marian Csontos [Thu, 27 Feb 2025 15:51:29 +0000 (16:51 +0100)]
post-release

9 months agopre-release 2.03.31 1691896916 v2_03_31
Marian Csontos [Thu, 27 Feb 2025 15:51:29 +0000 (16:51 +0100)]
pre-release 2.03.31

9 months agodoc: WHATS_NEW and release note update
Marian Csontos [Thu, 27 Feb 2025 15:49:34 +0000 (16:49 +0100)]
doc: WHATS_NEW and release note update

9 months agodoc: Apply markdown formatting
Marian Csontos [Tue, 14 Jan 2025 20:15:42 +0000 (21:15 +0100)]
doc: Apply markdown formatting

9 months agomisc: Typo fix s/loose/lose/ 25/head 1689265373
Eric Blake [Tue, 25 Feb 2025 22:30:06 +0000 (16:30 -0600)]
misc: Typo fix s/loose/lose/

Signed-off-by: Eric Blake <eblake@redhat.com>
9 months agomisc: Typo fix s/more then/more than/
Eric Blake [Tue, 25 Feb 2025 22:30:06 +0000 (16:30 -0600)]
misc: Typo fix s/more then/more than/

Also a few instances of s/less then/less than/.

Signed-off-by: Eric Blake <eblake@redhat.com>
9 months agoWHATS_NEW: update 17/head 1688598020
Zdenek Kabelac [Tue, 25 Feb 2025 15:35:45 +0000 (16:35 +0100)]
WHATS_NEW: update

9 months agomake: generate
Zdenek Kabelac [Tue, 25 Feb 2025 15:16:43 +0000 (16:16 +0100)]
make: generate

9 months agotest: check LVM_SUPPRESS_FD_WARNINGS
Zdenek Kabelac [Wed, 26 Feb 2025 00:16:47 +0000 (01:16 +0100)]
test: check LVM_SUPPRESS_FD_WARNINGS

Add test for suppression messages about leaked descriptors.

9 months agolvmlockd: drop return from void function
Zdenek Kabelac [Wed, 26 Feb 2025 00:25:25 +0000 (01:25 +0100)]
lvmlockd: drop return from void function

9 months agoman: update generator code
Zdenek Kabelac [Tue, 25 Feb 2025 13:51:20 +0000 (14:51 +0100)]
man: update generator code

Generate pages more complaint with 'mandoc -T lint'
Remove some generated space on EOL.
Replace .ad l with .na  macro.
Remove some .br duplicates.

9 months agoman: reformat args.h to fit in 80 lines
Zdenek Kabelac [Tue, 25 Feb 2025 23:20:10 +0000 (00:20 +0100)]
man: reformat args.h to fit in 80 lines

Compliance to mandoc -T lint to fit lines into 80 chars
in generated man pages.

9 months agoman: updates
Zdenek Kabelac [Tue, 25 Feb 2025 13:00:07 +0000 (14:00 +0100)]
man: updates

Updates for 'mandot -T lint'
Fit lines into 80 characters.
Use  .na .ad   instead of  .ad l  .ad b
Remove some misplaced  .P  & .br
Trim spaces for EOL.

9 months agolibdaemon: fix suppressing stray fd warnings
Jack Wilsdon [Thu, 17 Oct 2024 19:38:41 +0000 (20:38 +0100)]
libdaemon: fix suppressing stray fd warnings

Restore support for LVM_SUPPRESS_FD_WARNINGS as
this was seemingly lost with refactoring to
use daemon_close_stray_fds().

9 months agouncache and splitcache should restore inactive state 1688441105
David Teigland [Tue, 18 Feb 2025 23:22:52 +0000 (17:22 -0600)]
uncache and splitcache should restore inactive state

If an inactive LV is being cached in writeback mode, then
removing the cache does a temporary activation to flush
the cache back to the main LV.  However, it forgot to
deactivate the LV again, so the temporary activation
was left in place.

9 months agolvmlockd: add debug line
David Teigland [Tue, 18 Feb 2025 23:04:44 +0000 (17:04 -0600)]
lvmlockd: add debug line

9 months agolvmlockd: expand lockopt skip options 1688214295
David Teigland [Mon, 27 Jan 2025 22:17:10 +0000 (16:17 -0600)]
lvmlockd: expand lockopt skip options

The lockopt options for skipping locks were not being used
in many places, making it impossible to override locking to
forcibly run some commands.

9 months agotest: result is some for lvmpolld 20/head 22/head 24/head 1686702925
Zdenek Kabelac [Mon, 24 Feb 2025 23:29:19 +0000 (00:29 +0100)]
test: result is some for lvmpolld

Drop 'TEST WARNING' from this case - the code works the same
were for 'pvmove -b' polling as for lvmpolld.

Just keep there 'TODO' notice we want to eventually reduce amount
of 'worked' pvmove monitoring process - ATM there will be 1 per LV.

9 months agoman: clarify --stripes number of device
Salvatore Bonaccorso [Wed, 19 Feb 2025 12:04:34 +0000 (13:04 +0100)]
man: clarify --stripes number of device

The current manpage is unclear in the example of a raid10 type LV RAID
with --mirrors 1 --stripes 4. The number of devices in each raid1 mirror
is NumberStripes/(NumberMirrors+1). Thus the example should read:

e.g. mirrors 1 and stripes 4 will stripe data across two raid1
mirrors, where each mirror contains two devices.

Fixes: https://gitlab.com/lvmteam/lvm2/-/issues/26
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
9 months agoman: fix grammar in lvmlockd.8_main
Dion Bosschieter [Thu, 13 Feb 2025 14:06:25 +0000 (15:06 +0100)]
man: fix grammar in lvmlockd.8_main

Remove redundant 'the' in 'When the another VG'.

Signed-off-by: Dion Bosschieter <dionbosschieter@gmail.com>
9 months agoman: removing duplicate words in man pages.
Tyler Clark [Tue, 14 Jan 2025 02:14:42 +0000 (21:14 -0500)]
man: removing duplicate words in man pages.

This patch removes some sequentially duplicated words in a few man pages.

9 months agoclang: match prototype
Zdenek Kabelac [Mon, 24 Feb 2025 23:47:05 +0000 (00:47 +0100)]
clang: match prototype

9 months agocov: some missed arg_is_set changes
Zdenek Kabelac [Mon, 24 Feb 2025 23:30:11 +0000 (00:30 +0100)]
cov: some missed arg_is_set changes

9 months agolvconvert: validate mirror image counting
Zdenek Kabelac [Mon, 24 Feb 2025 23:31:03 +0000 (00:31 +0100)]
lvconvert: validate mirror image counting

Since _failed_mirrors_count() may eventually return -1,
add extra validation before using returned count.

9 months agothin: fix checking monitor mode
Zdenek Kabelac [Mon, 24 Feb 2025 23:28:33 +0000 (00:28 +0100)]
thin: fix checking monitor mode

Previous commit 874a8ab4d02a59c5 missed 'IGNORE' mode.
Fix it by adding rather 'explicit' test for this value,
so the code is better readable.

Also unlock memory earlier and drop unneeded <backtrace>
from return since we already logged error in this function.

9 months agolvmlockd: fix missing lvremove free_lv 1686619136
David Teigland [Mon, 24 Feb 2025 22:36:01 +0000 (16:36 -0600)]
lvmlockd: fix missing lvremove free_lv

Fix missing lockd_free_lv in commit
e3f0af8f1fd7 lvmlockd: fixes for lvremove

9 months agotests: reduce Exa test size 1686288652
Zdenek Kabelac [Mon, 24 Feb 2025 17:55:25 +0000 (18:55 +0100)]
tests: reduce Exa test size

Since kernel patch 3d9a9e9a77c5ebecda43b514f2b9659644b904d0  (6.14)
it seem device size is no limitted to <8Exa bytes (so LLONG loff_t
works across whole device).

So reduce our tested size to 8191 Peta  ~ <8 Exa.

9 months agotest: wait for polling finish
Zdenek Kabelac [Sun, 23 Feb 2025 23:36:47 +0000 (00:36 +0100)]
test: wait for polling finish

Increase the used mirror size for longer processing.

Add more -vvvv traces to pvmove to better chase test error.

Add extra code to wait for finish of polling pvmove after it's
been aborted - so it doesn't break 'next' test.

9 months agoWHATS_NEW: updates
Zdenek Kabelac [Wed, 19 Feb 2025 20:18:51 +0000 (21:18 +0100)]
WHATS_NEW: updates

9 months agocov: add value check
Zdenek Kabelac [Sun, 23 Feb 2025 19:09:50 +0000 (20:09 +0100)]
cov: add value check

9 months agocov: use arg_count for unchecked usage
Zdenek Kabelac [Sun, 23 Feb 2025 18:48:39 +0000 (19:48 +0100)]
cov: use arg_count for unchecked usage

Reserve usage of  'arg_is_set()' to tested use case and use
arg_count() for unchecked one.

9 months agocov: explicitly ignore value
Zdenek Kabelac [Sun, 23 Feb 2025 18:47:48 +0000 (19:47 +0100)]
cov: explicitly ignore value

9 months agoman: remarks and editorial changes for dmstats
Bjarni Ingi Gislason [Sun, 23 Feb 2025 00:45:24 +0000 (00:45 +0000)]
man: remarks and editorial changes for dmstats

Use "groff -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.
Use "mandoc -T lint  dmstats.8"
Use "test-groff -mandoc -t -ww -z dmstats.8"

-.-.

Lines containing '\c' (' \c' does not make sense):

503:.B \-\-units \c

-.-

Change '-' (\-) to '\(en' (en-dash) for a (numeric) range.
GNU gnulib has recently (2023-06-18) updated its
"build_aux/update-copyright" to recognize "\(en" in man pages.

dmstats.8:470:expressed as a hyphen separated range, for example: '1\-10'.

-.-.

Add a (no-break, "\ " or "\~") space between a number and a unit,
as these are not one entity.

1114:Create a 32M region 1G into device d0

-.-.

Add a "\&" after "e.g." and "i.e.", or use English words
(man-pages(7)).
Abbreviation points should be protected against being interpreted as
an end of sentence, if they are not, and that independent of the
current place on the line.

511:Can also specify custom units e.g. \fB\-\-units\ 3M\fP.

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

-.-.

The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

798:extents). This currently includes \fBxfs(5)\fP and \fBext4(5)\fP.
801:group, and the group alias is set to the \fBbasename(3)\fP of the

-.-.

Use thousand markers to make large numbers easy to read

560:is equivalent to 10000000. Latency values with a precision of less than

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

1:.TH DMSTATS 8 "Jun 23 2016" "Linux" "MAINTENANCE COMMANDS"

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

.-.

Additionally:

  Fix some arguments for '.TP'.  A single-font macro does not work with
'\c', so use a two-font macro.

-.-

  Use the pair ".na / .ad" to set no-adjustment (same result as '.ad l')
and '.ad' to restore previous adjustment.
[Replacing ".ad l" ... ".ad b"]

  Set singular '.ad b' to '.ad \*(AD' as the user should have the choice to
control the adjustment from the command line.

  Add an empty string to string 'AD' with '.as AD "\"' to avoid a warning
about an undefined string.

-.-

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.

Updated-by: zkabelac@redhat.com
9 months agoman: remarks and editorial changes for dmsetup
Bjarni Ingi Gislason [Sat, 22 Feb 2025 11:11:37 +0000 (11:11 +0000)]
man: remarks and editorial changes for dmsetup

Checking for defects with a new version

Use test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"
Use "groff -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.
Use "mandoc -T lint  dmsetup.8":
Use "test-groff -mandoc -t -ww -z dmsetup.8":

-.-.

Add a (no-break, "\ " or "\~") space between a number and a unit,
as these are not one entity.

-.-.

Use "\e" to print the escape character instead of "\\" (which gets
interpreted in copy mode).

487:with its hex value (two digits) prefixed by \\x.

-.-.

Strings longer than 3/4 of a standard line length (80)
Use "\:" to split the string at the end of an output line, for example a
long URL (web address)

1030 <name>,<uuid>,\:<minor>,<flags>,\:<table>\:[,<table>+]\:[;<name>,<uuid>,\:<minor>,<flags>,<table>\:[,<table>+]]

-.-.

Add a "\&" after "e.g." and "i.e.", or use English words
(man-pages(7)).
Abbreviation points should be protected against being interpreted as
an end of sentence, if they are not, and that independent of the
current place on the line.

581:Note: Same cookie should be used for same type of operations i.e. creation of
767:Attempts to remove all device definitions i.e. reset the driver.  This also runs
946:e.g. striped 2 32 /dev/hda1 0 /dev/hdb1 0

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

-.-.

Use \(en (en-dash) for a dash at the beginning (en) of a line,
or between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

1:.TH DMSETUP 8 "Apr 06 2006" "Linux" "MAINTENANCE COMMANDS"

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

Updated-by: <zkabelac@redhat.com>
9 months agopolldaemon: handle sigint from nanosleep
Zdenek Kabelac [Sat, 22 Feb 2025 21:14:53 +0000 (22:14 +0100)]
polldaemon: handle sigint from nanosleep

Handle interruption caught in sleep between polling and
abort() tool execution in such case.
(Although ATM we are not normally signalling the tool this way).

9 months agopolldaemon: enhance error tracking
Zdenek Kabelac [Sat, 22 Feb 2025 19:13:38 +0000 (20:13 +0100)]
polldaemon: enhance error tracking

Improve error handling in polling functions where errors
were previously ignored. These errors result from serious
failures (e.g., allocation errors) and should lead to a full
command exit, as the tool cannot function in such a state.

FIXME:

However, there is a fundamental design issue worth considering:
when a command like pvmove --abort cancels an ongoing operation,
the existing polling command continues running and only terminates
once it detects that there is nothing left to poll.

Next issue is perment reopening of a VG when 'monitoring' progress.

And the last is big trouble with '--interval 0' which is able to
wait in DM ioctl() and hold the VG lock, and there is not good way
to about such operation (other then sending a signal to such process).

9 months agolvmpolld: easier alloc code
Zdenek Kabelac [Thu, 20 Feb 2025 15:19:38 +0000 (16:19 +0100)]
lvmpolld: easier alloc code

Share _free_lvmpolld_lv() function.

9 months agotest: skip retry only for lvconvert
Zdenek Kabelac [Wed, 19 Feb 2025 21:05:38 +0000 (22:05 +0100)]
test: skip retry only for lvconvert

Mirror creation is creating log volumes and needs occasionally
retry loop for deactivation.

9 months agomakefile: remove old lcov files
Zdenek Kabelac [Wed, 19 Feb 2025 19:56:35 +0000 (20:56 +0100)]
makefile: remove old lcov files

Remove any older lcov generated files ('*.gcda|gcno') then the currently
generated 'make.file' before creating a new lcov report.

Otherwise we may hit the problem of using some older generated files
possibly with different format.

9 months agolibdm: restore missing symbols
Jianqi Zeng [Wed, 19 Feb 2025 06:49:33 +0000 (14:49 +0800)]
libdm: restore missing symbols

Restore missing symbols to the libdevmapper.so library.

These symbols:

dm_bitset_parse_list@@DM_1_02_138
and dm_tree_node_size_changed@Base

become 'lost' with commit: 40b277ae1799fc7a2e3f38b0abebd81a8e3d1995
which supposedly cleaned local 'symbols' from visibility,
however these missing symbols were impproperly exported.

Signed-off-by: Jianqi Zeng <zengjianqi@kylinos.cn>
9 months agolvmlockd: recognize error ELMERR 1680925257
David Teigland [Thu, 20 Feb 2025 16:16:49 +0000 (10:16 -0600)]
lvmlockd: recognize error ELMERR

9 months agolvmlockd: disallow shared activation of LV with cow snapshot 1679380741
David Teigland [Wed, 19 Feb 2025 22:19:42 +0000 (16:19 -0600)]
lvmlockd: disallow shared activation of LV with cow snapshot

The check for disallowing shared activation was missing
a check for this type.

9 months agotest: repeatedly restart lvmdbusd 1677468184
Zdenek Kabelac [Tue, 18 Feb 2025 23:32:27 +0000 (00:32 +0100)]
test: repeatedly restart lvmdbusd

It looks like occasionally supports_json() in cmdhandler.py
for some reason does not find  'fullreport' in err output
of lvm help...  let's see more traces...

9 months agorevert "test: aux gives more time for lvmdbusd start"
Zdenek Kabelac [Tue, 18 Feb 2025 23:21:50 +0000 (00:21 +0100)]
revert "test: aux gives more time for lvmdbusd start"

This reverts commit 8425c1b468af0caf2e1e36d1eb1c1b399ee22489.

Seems we have different problem with lvmdbusd test start.

9 months agotest: improve holding device open
Zdenek Kabelac [Tue, 18 Feb 2025 20:56:21 +0000 (21:56 +0100)]
test: improve holding device open

Use 'exec' to open device and then just pass descriptor to sleep.

9 months agolvmlockd: fixes for lvremove 1677064983
David Teigland [Mon, 17 Feb 2025 21:48:45 +0000 (15:48 -0600)]
lvmlockd: fixes for lvremove

The simple common case of locking the LV to remove with a
persistent lock would usually be fine, but there are a number
of special cases that were not addressed:
- no locking was done for removing cow snapshot
- direct locking to vdo pool
- dm-cache uncache using lvremove was not handled

9 months agolvmlockd: use lockd_lvcreate_lock for multiple LV types
David Teigland [Wed, 29 Jan 2025 23:48:18 +0000 (17:48 -0600)]
lvmlockd: use lockd_lvcreate_lock for multiple LV types

Use the same lockd_lvcreate_lock() for all cases in which
creating a new LV first requires locking another associated
LV, e.g. locking the pool or origin for the new LV.

9 months agotest: add check for no such file 1674815077
Zdenek Kabelac [Mon, 17 Feb 2025 13:58:17 +0000 (14:58 +0100)]
test: add check for no such file

9 months agocov: refactor code for warning
Zdenek Kabelac [Mon, 17 Feb 2025 13:55:44 +0000 (14:55 +0100)]
cov: refactor code for warning

Refactor resizing loop, so Coverity no longer sees
the loop as 'infinite' and the code is also readable.

9 months agocov: refactor code
Zdenek Kabelac [Mon, 17 Feb 2025 13:35:31 +0000 (14:35 +0100)]
cov: refactor code

Refactor code, so Coverity doesn't complain about over-running
an array with char*.
(IMHO this seemed like a problem in Coverity code evaluation)

9 months agocov: initialize arrays values
Zdenek Kabelac [Mon, 17 Feb 2025 12:12:03 +0000 (13:12 +0100)]
cov: initialize arrays values

9 months agoclang: refactor code for easier alloc tracking
Zdenek Kabelac [Sun, 16 Feb 2025 22:17:41 +0000 (23:17 +0100)]
clang: refactor code for easier alloc tracking

Refactor _get_split_name(). code to simplify detection of memory leak
in _destroy_split_name(). Now there are always just 2 pointers
instead of conditional pointer free() which is hard to follow.

9 months agoclang: call alloca with non-zero size
Zdenek Kabelac [Sun, 16 Feb 2025 20:45:51 +0000 (21:45 +0100)]
clang: call alloca with non-zero size

Make sure that some non 0 size is also for (mirrors == 0).

9 months agoclang: pointer protection
Zdenek Kabelac [Sun, 16 Feb 2025 20:42:12 +0000 (21:42 +0100)]
clang: pointer protection

9 months agoclang: validate command before exec
Zdenek Kabelac [Sun, 16 Feb 2025 17:32:36 +0000 (18:32 +0100)]
clang: validate command before exec

Add extra check for command existence in argv before fork().

9 months agoclang: use better readable code
Zdenek Kabelac [Sun, 16 Feb 2025 17:11:22 +0000 (18:11 +0100)]
clang: use better readable code

Here we make sure, that we always free fopen() fp.
As theoretically we may have had opened 'stdout'.

9 months agoclang: validation
Zdenek Kabelac [Sun, 16 Feb 2025 16:59:01 +0000 (17:59 +0100)]
clang: validation

9 months agotools: using proper header order
Zdenek Kabelac [Fri, 14 Feb 2025 19:00:32 +0000 (20:00 +0100)]
tools: using proper header order

ARG_COUNT is generated by processing command_enums and
then it can be used by command.h.

So correct include order and later use command.h.

9 months agocleanup: headers self compilable
Zdenek Kabelac [Fri, 14 Feb 2025 13:08:43 +0000 (14:08 +0100)]
cleanup: headers self compilable

In most cases header should be self-compilable, so the
do not expect other 'header' files to be used upfront
so the header would be compilable.

No functional change.

9 months agocleanup: match function prototype with definition
Zdenek Kabelac [Fri, 14 Feb 2025 14:28:16 +0000 (15:28 +0100)]
cleanup: match function prototype with definition

Match variable name in function definition with
its prototype. Pick the name which better fits
the usage.

No functional change.

9 months agocleanup: project headers in front
Zdenek Kabelac [Thu, 13 Feb 2025 15:13:50 +0000 (16:13 +0100)]
cleanup: project headers in front

Include project headers before system header files.

9 months agoclang: silence warning
Zdenek Kabelac [Fri, 14 Feb 2025 12:46:28 +0000 (13:46 +0100)]
clang: silence warning

Make the code pass through Coverity/clang.
As it didn't like theoretical access beyond
_yes[] & _no[] array elements.

9 months agoclang: correcting imprecise prototype
Zdenek Kabelac [Fri, 14 Feb 2025 13:11:20 +0000 (14:11 +0100)]
clang: correcting imprecise prototype

These internal header were using misleading variable names
in function prototypes, but correct names were used in
function definition. Noticed with:

clang-tidy --checks=readability-inconsistent-declaration-parameter-name

No functional change.

9 months agoclang: make pointer defined
Zdenek Kabelac [Sun, 16 Feb 2025 15:23:53 +0000 (16:23 +0100)]
clang: make pointer defined

9 months agoclang: add known mask value
Zdenek Kabelac [Sat, 15 Feb 2025 10:14:29 +0000 (11:14 +0100)]
clang: add known mask value

Bit flags likely should never have been 'enum' but since
we have this in a public header - it might be hard to
replace this. So at least add missing 'enum' element
we use.

9 months agoclang: check pointers
Zdenek Kabelac [Sun, 16 Feb 2025 15:23:42 +0000 (16:23 +0100)]
clang: check pointers

9 months agoclang: pointer validation
Zdenek Kabelac [Sat, 15 Feb 2025 10:11:53 +0000 (11:11 +0100)]
clang: pointer validation

9 months agoclang: better visibility of non-null lock_type
Zdenek Kabelac [Fri, 14 Feb 2025 23:32:49 +0000 (00:32 +0100)]
clang: better visibility of non-null lock_type

clang can't see transient result, however
it would be still better to check for type string just once.

9 months agoclang: ensure defined value
Zdenek Kabelac [Fri, 14 Feb 2025 18:20:11 +0000 (19:20 +0100)]
clang: ensure defined value

Although this radix_tree_simple code is not being unused ATM...

9 months agoclang: validate allocated buffer size
Zdenek Kabelac [Fri, 14 Feb 2025 19:16:14 +0000 (20:16 +0100)]
clang: validate allocated buffer size

Validate for not using 0 size arg for allocation,
however this can never heapen for running code...

9 months agoclang: trace rewind errno
Zdenek Kabelac [Fri, 14 Feb 2025 19:08:15 +0000 (20:08 +0100)]
clang: trace rewind errno

Although rewind() return void, it's API suggest
to check for 'errno' value.

9 months agoclang: reduce padding in struct cfg_def_item
Zdenek Kabelac [Fri, 14 Feb 2025 17:15:56 +0000 (18:15 +0100)]
clang: reduce padding in struct cfg_def_item

Reorder struct members to minimize padding.

9 months agoclang: reduce padding in struct command_name
Zdenek Kabelac [Fri, 14 Feb 2025 16:07:17 +0000 (17:07 +0100)]
clang: reduce padding in struct command_name

Reorder struct members to minimize padding.

9 months agoclang: refactor code to always run inner loop
Zdenek Kabelac [Fri, 14 Feb 2025 23:19:15 +0000 (00:19 +0100)]
clang: refactor code to always run inner loop

Make it more clear to analyzer the inner loop always runs.
Otherwise it may complain about *c being NULL.

9 months agoclang: valid area is required
Zdenek Kabelac [Sun, 16 Feb 2025 20:51:50 +0000 (21:51 +0100)]
clang: valid area is required

Do not try to check references when verifying
LV segments with missing area.

9 months agoclang: ensure extents is usable
Zdenek Kabelac [Sun, 16 Feb 2025 20:43:23 +0000 (21:43 +0100)]
clang: ensure extents is usable

Although the code was exiting only for  (update == 0),
the later code actually used requires 'extents' to exist
also for  (update != 0).

TODO: The logic here is not very clear, more testing needed.

9 months agoclang: fix double free in error path
Zdenek Kabelac [Sat, 15 Feb 2025 09:17:37 +0000 (10:17 +0100)]
clang: fix double free in error path

When prefix insertion to radix_tree would fail, the error
path might try to possible double free allocated memory.

9 months agoraid: set warn print level
Zdenek Kabelac [Sun, 16 Feb 2025 16:59:55 +0000 (17:59 +0100)]
raid: set warn print level

Since there conversion messages are not causing direct
command error, switch message level to log_warn().

9 months agoman lvm: add tag info 1670193977
David Teigland [Thu, 13 Feb 2025 18:16:54 +0000 (12:16 -0600)]
man lvm: add tag info

Restore basic info about tags that was dropped years ago
during the reworking for man page generation.
Also some other minor random updates.

9 months agolvcreate: accept lockopt option 1670143193
David Teigland [Thu, 13 Feb 2025 17:36:54 +0000 (11:36 -0600)]
lvcreate: accept lockopt option

The redundant lvcreate.c implementation of accepted options needs
to be removed.

9 months agotest: improve for use with older systems 1669332258
Zdenek Kabelac [Thu, 13 Feb 2025 09:50:23 +0000 (10:50 +0100)]
test: improve for use with older systems

Improve test, so it's also working on systems without delay_dev
and test is actually more 'race' resistant.

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