]> sourceware.org Git - lvm2.git/log
lvm2.git
21 months agotests: reduce shellcheck warns
Zdenek Kabelac [Thu, 9 Feb 2023 15:05:40 +0000 (16:05 +0100)]
tests: reduce shellcheck warns

Reduce warnings in tests.

21 months agotests: cleanup some shellcheck warns
Zdenek Kabelac [Thu, 9 Feb 2023 15:04:54 +0000 (16:04 +0100)]
tests: cleanup some shellcheck warns

Reduce shellcheck warnings about missing {} for possible array
dereference.

Make sure we are not loosing error code when assigning local vars
and explicitely ignore 'errors' from standalone lines when needed.

Add some missing quotes.

Use $() instead of ancient ``

Avoid writing some temporary data into /tmp - test need to store
files within its own 'testdir' - so it can be properly discarded.

21 months agotests: avoid using length
Zdenek Kabelac [Thu, 9 Feb 2023 13:02:17 +0000 (14:02 +0100)]
tests: avoid using length

Use ${#  for length instead.

21 months agotests: remove blank line
Zdenek Kabelac [Thu, 9 Feb 2023 12:35:11 +0000 (13:35 +0100)]
tests: remove blank line

21 months agotests: fix cutandpaste bug in wrapper
Zdenek Kabelac [Thu, 9 Feb 2023 12:42:11 +0000 (13:42 +0100)]
tests: fix cutandpaste bug in wrapper

Use correct variable name for assign.

21 months agomakefiles: avoid piping
Zdenek Kabelac [Thu, 9 Feb 2023 21:33:31 +0000 (22:33 +0100)]
makefiles: avoid piping

Addressing problem for user of system without default bash shell.

As reported "set -o pipefail" is a bashism that causes the build to
fail when /bin/sh does not point to bash.
For example, this has been observed causing build failures
on Gentoo when /bin/sh is symlinked to /bin/dash.

Rule has been reworked and we started to use .DELETE_ON_ERROR to
ensure that with any errors during file generation, such invalid
file is automatically removed.

Rules were reworked to avoid using pipe and instead use temporary
files when necessary.
Printing lines with echo was replaced with POSIX recomended 'printf'
as proposed by reporter since handling of escape characters and
the "-n" flag for "echo" aren't portable across shells.

Also some build deps has been added.

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1822280
Gentoo-bug: https://bugs.gentoo.org/682404
Gentoo-bug: https://bugs.gentoo.org/716496
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1822280

Reported-by: Michael Orlitzky <michael@orlitzky.com>
TODO: investage if the temporary files could be handled via some
intermediate target solution - ATM I couldn't make it work equally
well as current solution use shell 'trap' to remove temp file.

21 months agomakefiles: keep removing anchient files
Zdenek Kabelac [Thu, 9 Feb 2023 21:50:59 +0000 (22:50 +0100)]
makefiles: keep removing anchient files

Commit dropping lvmetad support 117160b27e510dceb1ed6acf995115c040acd88d
also removed cleaning of its generated files. However we need to keep
this functionality, otherwise we can leak them during various bisect.
Easier is to keep such rules forever.

Also commit c1ab9fb37faee56cee278ccd94cb958d30d61b94 moved cmds.h to
include, so again keep it removed so it's not left there and in any
case could not misslead anyone.

21 months agolvresize_fs_helper: cleanup shellcheck warns
Zdenek Kabelac [Thu, 9 Feb 2023 15:22:11 +0000 (16:22 +0100)]
lvresize_fs_helper: cleanup shellcheck warns

Use commands directly in 'if cmd; then'.
Use shell vars in $(( )) in recommended way.

21 months agoconfigure: update
Zdenek Kabelac [Wed, 8 Feb 2023 15:15:26 +0000 (16:15 +0100)]
configure: update

21 months agoconfigure.ac: misc updates
Zdenek Kabelac [Thu, 9 Feb 2023 16:37:17 +0000 (17:37 +0100)]
configure.ac: misc updates

Use literal assignments with "" for better visibility in text editor.
Use more [] for AC_ macro args.

21 months agoconfigure.ac: remove some lvmetad leftovers
Zdenek Kabelac [Wed, 8 Feb 2023 15:30:40 +0000 (16:30 +0100)]
configure.ac: remove some lvmetad leftovers

Remove unused parts of configure and udev rules since lvmetad is gone.

21 months agolvresize: better detection of BLKID_SUBLKS_FSINFO
Zdenek Kabelac [Wed, 8 Feb 2023 13:39:43 +0000 (14:39 +0100)]
lvresize: better detection of BLKID_SUBLKS_FSINFO

Use configure detection instead of trying to directly include
blkid.h inside lvresize.c - where we do not pass in BLKID_CFLAGS
and since we actually do not need to use blkid there, introeduce
test variable HAVE_BLKID_SUBLKS_FSINFO and avoid trying to
use blkid.h in this place - this also fixes builing problem for
systems without blkid.h.

21 months agoconfigure.ac: only use `AS_CASE` for conditional blocks
David Seifert [Sun, 27 Nov 2022 14:35:07 +0000 (15:35 +0100)]
configure.ac: only use `AS_CASE` for conditional blocks

Like `AS_IF([...])`, `AS_CASE` bubbles nested `AC_REQUIRE()` to the
top-level.

21 months agoconfigure.ac: only use `AS_IF` for conditional blocks
David Seifert [Sun, 27 Nov 2022 14:35:06 +0000 (15:35 +0100)]
configure.ac: only use `AS_IF` for conditional blocks

`AS_IF([...])` is more portable, as it respects macro expansions of
`AC_REQUIRE()`.

This is recommended Autoconf best practice, since in nested
conditionals, it is generally unknowable whether some macro invokes
`AC_REQUIRE()` deep down:
https://www.gnu.org/software/autoconf/manual/autoconf-2.71/html_node/Common-Shell-Constructs.html#index-AS_005fIF-1

As a result, the hacky `pkg_config_init` function is not needed
anymore, since any `PKG_*` invocation will ensure that
`PKG_PROG_PKG_CONFIG` will have been called, due to the fact that
`AC_REQUIRE()` will trickle up.

21 months agoconfigure.ac: use only portable POSIX shell
David Seifert [Sun, 27 Nov 2022 14:35:05 +0000 (15:35 +0100)]
configure.ac: use only portable POSIX shell

`[[ ... ]]` only works in bash, and not in POSIX sh, specifically
dash fails on this, which is a popular alternative to bash for running
configure scripts.

test's `-a` and `-o` options are considered obsolescent by POSIX,
because they interact badly with expressions and can become ambiguous
depending on string arguments:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

`==` only works in bash.

21 months agometadata-exported.h: correcting definition
Zdenek Kabelac [Fri, 10 Feb 2023 16:48:28 +0000 (17:48 +0100)]
metadata-exported.h: correcting definition

Fixing minor mismatch between definition and declaration of
update_thin_pool_params().

21 months agolvm: fix typos
Zdenek Kabelac [Thu, 9 Feb 2023 16:05:01 +0000 (17:05 +0100)]
lvm: fix typos

Patch aec5e573afe610070eb2c6bed675d2a7c0efc7e8 was fixing some
of typos only in generated file, but they need to be fixed in
the source files.

21 months agovgimportdevices: LOCK_EX requires <sys/file.h> include
Jory Pratt [Tue, 7 Feb 2023 13:27:12 +0000 (14:27 +0100)]
vgimportdevices: LOCK_EX requires <sys/file.h> include

https://linux.die.net/man/2/flock

Bug: https://bugs.gentoo.org/887259

21 months agovgimportclone: fix non-duplicate PV with non-unique basevgname arg
David Teigland [Thu, 9 Feb 2023 23:14:19 +0000 (17:14 -0600)]
vgimportclone: fix non-duplicate PV with non-unique basevgname arg

Fix hang of vgimportclone command when:
the PV(s) being imported are not actually clones/duplicates, and
the -n vgname arg is the same as the current vgname.

(Not the intended use of the command, but it should still work.)

In this case, the old and new vgnames ended up being the same, when
the code expected they would be different.  A file lock on both the
old and new vgnames is used, so when both flocks are on the same
file, the second blocks indefinitely.

Fix the new vgname to be the old name plus a numeric suffix, which
is the expected result.

21 months agoudev: import previous results of blkid when in suspended state
Yu Watanabe [Wed, 1 Feb 2023 15:28:12 +0000 (00:28 +0900)]
udev: import previous results of blkid when in suspended state

Follow-up for e10f67e91728f1e576803df884049ecbd92874d0.

The commit e10f67e91728f1e576803df884049ecbd92874d0 tries to keep device
node symlinks even if the device is in the suspended state. However,
necessary properties that may previously obtained by the blkid command
were not imported at least in the .rules file. So, unless ID_FS_xyz
properties are imported by another earlier .rules file, the device node
symlinks are still lost when event is processed in the suspended state.

Let's explicitly import the necessary properties.

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2158628
GHPR: https://github.com/lvmteam/lvm2/pull/105

21 months agodevice_id: ignore quotes in device id
David Teigland [Mon, 6 Feb 2023 18:18:55 +0000 (12:18 -0600)]
device_id: ignore quotes in device id

A t10 wwid string was found containing a " character
which breaks vg metadata parsing.  Ignore any quotation
marks in device id strings.

21 months agovg_read: remove unused code for md components
David Teigland [Thu, 2 Feb 2023 22:15:13 +0000 (16:15 -0600)]
vg_read: remove unused code for md components

This code was no longer used after ommit
87ee401eea3c3c3958ec5cda6e5c246b80503b8c

21 months agoudev: remove rule for explicit creation of /dev/mapper/control
Peter Rajnoha [Thu, 2 Feb 2023 14:30:30 +0000 (15:30 +0100)]
udev: remove rule for explicit creation of /dev/mapper/control

We used KERNEL=="device-mapper", NAME="/dev/mapper/control" udev rule to
create the /dev/mapper/control file. The "NAME" rule should be only used
to rename network devices, otherwise udev issues a warning message. The
device-mapper driver has proper DEVNAME=/dev/mapper/control propagated
in the uevent environment when it is loaded so we don't need further
instruction on where to create the node - udev knows already.

Also, these days, it is created directly by kernel inside devtmpfs.
This makes the NAME="/dev/mapper/control" rule completely obsolete.

21 months agoudev: don't reset SYSTEMD_READY in udev for PVs on MD and loop
Peter Rajnoha [Wed, 1 Feb 2023 13:33:25 +0000 (14:33 +0100)]
udev: don't reset SYSTEMD_READY in udev for PVs on MD and loop

Since 67722b312390cdab29c076c912e14bd739c5c0f6, we have a new mechanism
to run the autoactivation from udev. With this change, we also replaced
the way the LVM autoactivation service is instantiatiated - instead of
setting the SYSTEM_WANTS udev variable (which systemd read and then
instantiated the service), we're now directly instantiating the
transient 'lvm-activate-<vgname>' service by calling systemd-run.

As such, we don't need to bother with setting the SYSTEMD_READY variable
for foreign devices anymore (in this case, MD and loop devices on top of
which there's a PV).

Before, we set the SYSTEMD_READY variable to make sure that the SYSTEMD_WANTS
is applied correctly - the service instantiation was edge-triggered by
flipping the SYSTEMD_READY from 0 to 1 and at the same time having the
SYSTEMD_WANTS variable set to the service name to instantiate. We're
using systemd-run now so this condition does not apply anymore.

Also, it was not completely correct to set SYSTEMD_READY for foreign
devices because there might be cases where this could cause issues,
see also https://github.com/lvmteam/lvm2/issues/94.

21 months agolv/vgchange: when refreshing whole vg skip snapshot
Zdenek Kabelac [Tue, 31 Jan 2023 21:48:43 +0000 (22:48 +0100)]
lv/vgchange: when refreshing whole vg skip snapshot

When refreshing all LVs in a VG, skip processing of thick snapshots,
since they will be refreshed through its origin LV.
Should reduce some unnecessary ioctl().

21 months agodebug: compatibility with x32 ABI
Zdenek Kabelac [Wed, 18 Jan 2023 13:27:56 +0000 (14:27 +0100)]
debug: compatibility with x32 ABI

Keep the conversion 64bit as on x32 arch time_t is 64bit value
and we may loose precision  (y2038).

TODO: like use universal string for time printing as in log/log.c
_set_time_prefix()

21 months agodevice_mapper: reactivate siblings for snapshot
Zdenek Kabelac [Mon, 30 Jan 2023 13:32:44 +0000 (14:32 +0100)]
device_mapper: reactivate siblings for snapshot

When activating origin and its thick snapshots, ensure the
origin's LV udev processing is finished first and after this
reactivate its snapshot so the udev can scan them afterwards.

This should fix the problems for users using UUID of such device
in their fstab and occasionaly mounted snapshot instead of origin LV.

21 months agodevice_mapper: reduce unnecessary looping passed
Zdenek Kabelac [Mon, 30 Jan 2023 13:31:04 +0000 (14:31 +0100)]
device_mapper: reduce unnecessary looping passed

While looping through the list of nodes, check if there is higher
priority present and another iteration is still needed.

21 months agoarchive: update message
Zdenek Kabelac [Tue, 17 Jan 2023 22:58:41 +0000 (23:58 +0100)]
archive: update message

Better suggesting message as suggested by RHBZ 2123151.

21 months agopvscan: recognize "pci" as a common symlink component in filters
David Teigland [Fri, 27 Jan 2023 22:46:03 +0000 (16:46 -0600)]
pvscan: recognize "pci" as a common symlink component in filters

In case the filter strings don't include "/dev/disk", and only
include "pci".

21 months agovgchange autoactivation: skip regex filter containing symlinks
David Teigland [Fri, 27 Jan 2023 21:56:06 +0000 (15:56 -0600)]
vgchange autoactivation: skip regex filter containing symlinks

"vgchange -aay --autoactivation event" is called by our udev rule.
When the udev rule runs, symlinks for devices may not all be created
yet.  If the regex filter contains symlinks, it won't work correctly.
This command uses devices that already passed through pvscan.  Since
pvscan applies the regex filter correctly, this command inherits the
filtering from pvscan and can skip the regex filter itself.

See the previous commit
"pvscan: use alternate device names from DEVLINKS to check filter"

21 months agopvscan: use alternate device names from DEVLINKS to check filter
David Teigland [Thu, 19 Jan 2023 23:37:31 +0000 (17:37 -0600)]
pvscan: use alternate device names from DEVLINKS to check filter

pvscan --cache <dev> is called by our udev rule at a time when all
the symlinks for <dev> may not be created yet (by other udev rules.)
The regex filter in lvm.conf may refer to <dev> using a symlink name
that hasn't yet been created, which would cause <dev> to not match
the filter regex.  The DEVLINKS env var, set by udev, contains all
the symlink names for <dev> that have been or will be created.
So, we add all these symlink names to dev->aliases, as if we had
found them in /dev.  This allows <dev> to be recognized by a regex
filter containing a symlink for <dev>.

21 months agolvresize: fail early if crypt device is missing
David Teigland [Mon, 30 Jan 2023 23:12:11 +0000 (17:12 -0600)]
lvresize: fail early if crypt device is missing

If extending an LV with crypto_LUKS on it, and the crypt device
is missing, then fail the command before extending the LV.

21 months agolvresize: fail early if mounted LV was renamed
David Teigland [Thu, 26 Jan 2023 20:00:00 +0000 (14:00 -0600)]
lvresize: fail early if mounted LV was renamed

If a mounted LV is renamed, then fs resizing utilities will fail,
so detect this condition and fail the command before any changes
are made.

21 months agoRevert "lvresize: enable crypt resizing with --force"
David Teigland [Wed, 25 Jan 2023 15:30:05 +0000 (09:30 -0600)]
Revert "lvresize: enable crypt resizing with --force"

It looks like force was not being used to enable crypt resize,
but rather to force an inconsistency between LV and crypt
sizes, so this is either not needed or force in this case
should have some other meaning.

This reverts commit ed808a9b548ca59221d512bfb7ae581e8367fe50.

21 months agoRevert "makefiles: fix grep warning from make" dev-mcsontos-fix-make-rpm
Marian Csontos [Wed, 25 Jan 2023 08:46:18 +0000 (09:46 +0100)]
Revert "makefiles: fix grep warning from make"

This reverts commit 92199ad0b98586182a52e2f8cd82c06336e306f1.

This breaks make rpm.

21 months agolvresize: enable crypt resizing with --force
David Teigland [Fri, 20 Jan 2023 17:56:40 +0000 (11:56 -0600)]
lvresize: enable crypt resizing with --force

Update previous commit
  "lvresize: only resize crypt when fs resize is enabled"
to enable crypt resizing when --force is set and --resizefs
is not set.  This is because it's been allowed in the past
and people have used it, but it's not a good idea.

21 months agolvresize: only resize crypt when fs resize is enabled
David Teigland [Thu, 19 Jan 2023 17:36:51 +0000 (11:36 -0600)]
lvresize: only resize crypt when fs resize is enabled

There were a couple of cases where lvresize, without --fs resize,
was resizing the crypt layer above the LV.  Resizing the crypt
layer should only be done when fs resizing is enabled (even if the
fs is already small enough due to being independently reduced.)

Also, check the size of the crypt device to see if it's already
been reduced independently, and skip the cryptsetup resize if
it's not needed.

22 months agomakefiles: fix grep warning from make
Zdenek Kabelac [Sun, 15 Jan 2023 20:42:41 +0000 (21:42 +0100)]
makefiles: fix grep warning from make

Remove unnecessary '\'.

22 months agomakefiles: comment out hiding dir entering
Zdenek Kabelac [Thu, 12 Jan 2023 15:52:01 +0000 (16:52 +0100)]
makefiles: comment out hiding dir entering

While the output of building looks more polished, text editors fail to
find source file from compile errors - so until we start to print
all file with full paths - comment out this make build parameter.

22 months agolibdm: correcting ifdef possition
Zdenek Kabelac [Sun, 15 Jan 2023 20:42:13 +0000 (21:42 +0100)]
libdm: correcting ifdef possition

Fix building without ioctl support.

22 months agotests: vdo resizing
Zdenek Kabelac [Mon, 16 Jan 2023 00:11:37 +0000 (01:11 +0100)]
tests: vdo resizing

22 months agovdo: resize requires active vdopool volume
Zdenek Kabelac [Sun, 15 Jan 2023 20:27:57 +0000 (21:27 +0100)]
vdo: resize requires active vdopool volume

ATM kernel VDO target does not handle resize of inactive VDO LVs
so prevent users corrupting such LVs and require active such LVs.

22 months agovdo: fix and enhance vdo constain checking
Zdenek Kabelac [Sun, 15 Jan 2023 20:27:37 +0000 (21:27 +0100)]
vdo: fix and enhance vdo constain checking

Enhance checking vdo constains so it also handles changes of active VDO LVs
where only added difference is considered now.

For this also the reported informational message about used memory
was improved to only list consuming RAM blocks.

22 months agovdo: read live vdo size configuration
Zdenek Kabelac [Sun, 15 Jan 2023 20:24:28 +0000 (21:24 +0100)]
vdo: read live vdo size configuration

Introduce struct vdo_pool_size_config usable to calculate necessary
memory size for active VDO volume.

Function lv_vdo_pool_size_config() is able to read out this
configuration out of runtime DM table line.

22 months agovdo: check memory only in non critical section
Zdenek Kabelac [Tue, 10 Jan 2023 20:12:22 +0000 (21:12 +0100)]
vdo: check memory only in non critical section

When we are actually resizing VDO device - we need to check size only in
non-critical section - otherwise we are checking

22 months agolvresize: use standard extent conversion function
Zdenek Kabelac [Tue, 10 Jan 2023 17:09:51 +0000 (18:09 +0100)]
lvresize: use standard extent conversion function

We need to validate whether the requested resizing size can be
expressed with given extent_size.

22 months agofix typo
lilinjie [Wed, 4 Jan 2023 05:21:13 +0000 (13:21 +0800)]
fix typo

Signed-off-by: lilinjie <lilinjie@uniontech.com>
(cherry picked from commit 81b1f5bc3bac0e2e9099b67162da7d1a4995c5f4)

22 months agolvmlockd: Fix syntax error in previous commit
Marian Csontos [Wed, 11 Jan 2023 12:34:38 +0000 (13:34 +0100)]
lvmlockd: Fix syntax error in previous commit

22 months agolvmlockd: fix report of lv_active_exclusively for special lv types
David Teigland [Tue, 10 Jan 2023 21:23:16 +0000 (15:23 -0600)]
lvmlockd: fix report of lv_active_exclusively for special lv types

Cover a case missed by the recent commit e0ea0706d
"report: query lvmlockd for lv_active_exclusively"

Fix the lv_active_exclusively value reported for thin LVs.
It's the thin pool that is locked in lvmlockd, and the thin
LV state was mistakenly being queried and not found.

Certain LV types like thin can only be activated exclusively, so
always report lv_active_exclusively true for these when active.

22 months agotests: vgimportclone with incomplete pv list and nomda pv
David Teigland [Thu, 5 Jan 2023 20:47:49 +0000 (14:47 -0600)]
tests: vgimportclone with incomplete pv list and nomda pv

22 months agovgimportclone: fix importing PV without metadata
David Teigland [Thu, 5 Jan 2023 20:28:31 +0000 (14:28 -0600)]
vgimportclone: fix importing PV without metadata

If one of the PVs in the VG does not hold metadata, then the
command would fail, thinking that PV was from a different VG.
Also add missing free on that error path.

22 months agotests: lvresize-fs-crypt using helper only for crypt dev
David Teigland [Tue, 3 Jan 2023 20:35:26 +0000 (14:35 -0600)]
tests: lvresize-fs-crypt using helper only for crypt dev

22 months agolvresize: fix cryptsetup resize in helper
David Teigland [Tue, 3 Jan 2023 17:38:33 +0000 (11:38 -0600)]
lvresize: fix cryptsetup resize in helper

typo used "cryptresize" as command name

this affects cases where the file system is resized
independently, and then the lvresize command is used
which only needs to resize the crypt device and the LV.

22 months agodoc: fix typos in documentation
Samanta Navarro [Fri, 30 Dec 2022 11:52:49 +0000 (11:52 +0000)]
doc: fix typos in documentation

Typos found with codespell.

22 months agopost-release
Marian Csontos [Tue, 3 Jan 2023 15:02:07 +0000 (16:02 +0100)]
post-release

22 months agopre-release
Marian Csontos [Thu, 22 Dec 2022 15:07:35 +0000 (16:07 +0100)]
pre-release

22 months agoWHATS_NEW: update v2_03_18
Marian Csontos [Thu, 22 Dec 2022 15:06:04 +0000 (16:06 +0100)]
WHATS_NEW: update

22 months agopvscan: free unused device_id
Zdenek Kabelac [Tue, 20 Dec 2022 13:17:34 +0000 (14:17 +0100)]
pvscan: free unused device_id

Fix memleak in function.

22 months agocov: use long type for time_t calcs
Zdenek Kabelac [Tue, 20 Dec 2022 13:11:57 +0000 (14:11 +0100)]
cov: use long type for time_t calcs

Some for y38k - calculations can handle 64b time_t.

22 months agocov: fix buffer size usage
Zdenek Kabelac [Tue, 20 Dec 2022 12:58:31 +0000 (13:58 +0100)]
cov: fix buffer size usage

Count with extra 1 byte for buffer end '\0'.

22 months agocov: remove unused header files
Zdenek Kabelac [Tue, 20 Dec 2022 12:54:59 +0000 (13:54 +0100)]
cov: remove unused header files

22 months agovdo: fix reader error path
Zdenek Kabelac [Tue, 20 Dec 2022 12:52:31 +0000 (13:52 +0100)]
vdo: fix reader error path

Nothing to be closed on this error path.

23 months agolvextend: fix overprovisioning check for thin lvs
David Teigland [Thu, 15 Dec 2022 15:57:04 +0000 (09:57 -0600)]
lvextend: fix overprovisioning check for thin lvs

18722dfdf4d3 lvresize: restructure code
mistakenly changed the overprovisioning check from applying
to all lv_is_thin_type lvs to only lv_is_thin_pool lvs, so
it no longer applied when extending thin lvs.  The result
was missing warning messages when extending thin lvs.

23 months agowritecache: support settings metadata_only and pause_writeback
David Teigland [Thu, 8 Dec 2022 22:42:04 +0000 (16:42 -0600)]
writecache: support settings metadata_only and pause_writeback

Two new settings for tuning dm-writecache.

23 months agolvchange: handle unrecognized writecache setting
David Teigland [Thu, 8 Dec 2022 21:48:30 +0000 (15:48 -0600)]
lvchange: handle unrecognized writecache setting

It was being ignored.

23 months agodevice_id: fix segfault verifying serial for non-pv
David Teigland [Fri, 2 Dec 2022 17:59:09 +0000 (11:59 -0600)]
device_id: fix segfault verifying serial for non-pv

The recent change that verifies sys_serial system.devices entries
using the PVID did not exclude non-PV devices from being checked.
The verification code would attempt to use du->pvid which was null
for the non-PVs causing a segfault.

23 months agodevice_id: check return value of label_read_pvid
David Teigland [Thu, 1 Dec 2022 17:49:51 +0000 (11:49 -0600)]
device_id: check return value of label_read_pvid

for covscan

23 months agodevice_id: _get_devs_with_serial_numbers add missing free
David Teigland [Thu, 1 Dec 2022 17:43:24 +0000 (11:43 -0600)]
device_id: _get_devs_with_serial_numbers add missing free

on malloc failure path

23 months agodevice_id: add null id->name null check
David Teigland [Thu, 1 Dec 2022 16:38:48 +0000 (10:38 -0600)]
device_id: add null id->name null check

for covscan

23 months agolvmcache: fix strncpy len for wwid
David Teigland [Thu, 1 Dec 2022 16:03:06 +0000 (10:03 -0600)]
lvmcache: fix strncpy len for wwid

23 months agolvmlockd: fix missing closedir
David Teigland [Thu, 1 Dec 2022 15:53:57 +0000 (09:53 -0600)]
lvmlockd: fix missing closedir

in get_local_nodeid from recent lock purge feature:
  lvmlockd: purge the lock resources left in previous lockspace

23 months agolvmdbusd: Add command_log_selection to command line
Tony Asleson [Tue, 29 Nov 2022 16:04:17 +0000 (10:04 -0600)]
lvmdbusd: Add command_log_selection to command line

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2145114

23 months agolvmdbusd: Move get_error_msg to utils
Tony Asleson [Tue, 29 Nov 2022 16:00:39 +0000 (10:00 -0600)]
lvmdbusd: Move get_error_msg to utils

Moving this so we can re-use outside of lvm_shell_proxy.

23 months agolvmdbustest: Add test to ensure error collection
Tony Asleson [Tue, 29 Nov 2022 15:57:20 +0000 (09:57 -0600)]
lvmdbustest: Add test to ensure error collection

Recreates https://bugzilla.redhat.com/show_bug.cgi?id=2145114

23 months agoman: dmsetup concise format consitency
Zdenek Kabelac [Fri, 25 Nov 2022 13:19:57 +0000 (14:19 +0100)]
man: dmsetup concise format consitency

Use <name> consistenly.

23 months agodmsetup: fix udev event handling for create
Zdenek Kabelac [Fri, 25 Nov 2022 14:45:47 +0000 (15:45 +0100)]
dmsetup: fix udev event handling for create

With newer kernels (>5.13)  DM_CREATE no longer generates
uevent for DM devices without table.
There are even no sysfs block device entries in such case,
although device has asigned major:minor and it is being listed
by 'dmsetup info'.

So this patch calculates amount of 'table' lines and in case
no table line comes from cmdline or stdin - waiting on cookie
is avoided generically instead of disabling just case with
option --notable - which then also skipped handling of an
option --addnodeoncreate (which is however historical and
should be avoided)

As a result there should be no leaking udev cookies and endlessly
waiting commands like this:

dmsetup create mytestdev  </dev/null

23 months agoconfigure: update
Zdenek Kabelac [Wed, 23 Nov 2022 12:18:07 +0000 (13:18 +0100)]
configure: update

23 months agolvmpolld: fix `strerror_r` check for musl
Sam James [Sat, 19 Nov 2022 16:51:09 +0000 (17:51 +0100)]
lvmpolld: fix `strerror_r` check for musl

We can't assume that strerror_r returns char* just because _GNU_SOURCE is
defined. We already call the appropriate autoconf test, so let's use its
result (STRERROR_R_CHAR_P).

Note that in configure, _GNU_SOURCE is always set, but we add a defined
guard just in case for futureproofing.

Bug: https://bugs.gentoo.org/869404

23 months agoconfigure: allow for overriding of `readelf`
David Seifert [Sat, 19 Nov 2022 16:51:08 +0000 (17:51 +0100)]
configure: allow for overriding of `readelf`

This allows users to use e.g. `llvm-readelf`
on systems with binutils as default.

Bug: https://bugs.gentoo.org/840628

23 months agotests: devicesfile-vpd-ids add nvme wwid
David Teigland [Mon, 21 Nov 2022 16:57:30 +0000 (10:57 -0600)]
tests: devicesfile-vpd-ids add nvme wwid

2 years agoreport: query lvmlockd for lv_active_exclusively
corubba [Tue, 1 Nov 2022 21:23:47 +0000 (22:23 +0100)]
report: query lvmlockd for lv_active_exclusively

Query LV lock state in lvmlockd to report lv_active_exclusively
for active LVs in a shared VGs.  As with all lvmlockd state,
it is from the perspective of the local node.

Signed-off-by: corubba <corubba@gmx.de>
2 years agoreport: adjust lv_active_remotely for shared VGs
corubba [Tue, 1 Nov 2022 21:18:19 +0000 (22:18 +0100)]
report: adjust lv_active_remotely for shared VGs

Add a note to the manpage that lvmlockd is unable to determine
accurately and without side-effects whether a LV is remotely active.
Also change the value of the lv_active_remotely option from false to
undefined for shared VGs to distinctly communicate that inability to
users. Only for local VGs it can be definitely stated that they are not
remotely active.

Signed-off-by: corubba <corubba@gmx.de>
2 years agopost-release
Marian Csontos [Thu, 10 Nov 2022 13:21:57 +0000 (14:21 +0100)]
post-release

2 years agopre-release v2_03_17
Marian Csontos [Thu, 10 Nov 2022 09:23:38 +0000 (10:23 +0100)]
pre-release

2 years agomake: generate
Marian Csontos [Thu, 10 Nov 2022 08:57:57 +0000 (09:57 +0100)]
make: generate

2 years agovdo: improve validation message
Zdenek Kabelac [Tue, 8 Nov 2022 11:40:21 +0000 (12:40 +0100)]
vdo: improve validation message

Rephrase.

2 years agolvcreate: fix error path return values
Zdenek Kabelac [Tue, 8 Nov 2022 11:39:25 +0000 (12:39 +0100)]
lvcreate: fix error path return values

Return failing error code for return path, as 'return 0' in this
case was returning success.

2 years agotests: update test to handle different status
Zdenek Kabelac [Fri, 4 Nov 2022 16:00:48 +0000 (17:00 +0100)]
tests: update test to handle different status

Since now we change deduplication with V4 table line change,
the modification tends to be faster and we can capture for a few ms
also 'status' about opening or closing deduplication index.
Use 'grep -E' to handle both words.

2 years agovdo: enhance detection of virtual size
Zdenek Kabelac [Sat, 5 Nov 2022 22:10:36 +0000 (23:10 +0100)]
vdo: enhance detection of virtual size

Improve detection of VDO virtual size - so it's not reading VDO
metadata when VDO device is already active and instead we reuse
existing table line for knowing existing metadata size.

NOTE: if there is ever going to be added support for reduction
of VDO virtual size - this method will need to be reworked to
allow size difference only within 'extent_size' alignment.

2 years agovdo: replace errors with debug
Zdenek Kabelac [Fri, 4 Nov 2022 15:27:56 +0000 (16:27 +0100)]
vdo: replace errors with debug

As we actully use reading of VDO metadata only as extra 'information' source,
and not error command - switch to 'log_debug()' severity with messages
out of parser code.

2 years agodevices: factor common list functions
David Teigland [Mon, 7 Nov 2022 17:38:46 +0000 (11:38 -0600)]
devices: factor common list functions

which were duplicated in various places

2 years agodevice_id: handle duplicate serial numbers
David Teigland [Mon, 31 Oct 2022 21:14:01 +0000 (16:14 -0500)]
device_id: handle duplicate serial numbers

Handle multiple devices using the same serial number as
their device id.  After matching devices to devices file
entries, if there is a discrepency between the ondisk PVID
and the devices file PVID, then rematch devices to
devices file entries using PVID, looking at all disks
on the system with the same serial number.

2 years agodevice_id: look for serial number in other locations
David Teigland [Mon, 24 Oct 2022 21:23:36 +0000 (16:23 -0500)]
device_id: look for serial number in other locations

Only /sys/dev/block/major:minor/device/serial was read to find
a disk serial number, but a serial number seems to be reported
more often in other locations, so check these also:
/sys/dev/block/major:minor/device/vpd_pg80
/sys/class/block/vda/serial (for virtio disks only)

2 years agodevice_mapper: vdo V4 avoid messaging
Zdenek Kabelac [Thu, 27 Oct 2022 21:58:42 +0000 (23:58 +0200)]
device_mapper: vdo V4 avoid messaging

With V4 format build table line with compression and
deduplication and skip sending any messages to set up
these parameters.

2 years agodev_manager: accept misalined vdo pools.
Zdenek Kabelac [Wed, 26 Oct 2022 12:38:29 +0000 (14:38 +0200)]
dev_manager: accept misalined vdo pools.

Since lvm2 may create VDO pool virtual size aligned only on extent size
while VDO itself is just 4K aligned - we need to support such misalign.

2 years agodevice_mapper: add parser for vdo metadata
Zdenek Kabelac [Wed, 26 Oct 2022 12:33:09 +0000 (14:33 +0200)]
device_mapper: add parser for vdo metadata

Add very simplistic parser of vdo metadata to be able to obtain
logical_blocks stored within vdo metadata - as lvm2 may
submit smaller value due to internal aligment rules.

To avoid creation of mismatching table line - use this number
instead the one provided by lvm2.

2 years agoconfigure: update use_devicesfile in example.conf
Zdenek Kabelac [Mon, 24 Oct 2022 16:03:42 +0000 (18:03 +0200)]
configure: update use_devicesfile in example.conf

Example.conf missed to properly replace default value for
use_devicesfile setting and left there @VAR@.

2 years agovgchange systemid: use tag or select
David Teigland [Mon, 31 Oct 2022 13:54:33 +0000 (08:54 -0500)]
vgchange systemid: use tag or select

The command can do this but the command defs
were missing the annotation to allow it.

2 years agodevice_id: remove debug trace
David Teigland [Mon, 24 Oct 2022 21:19:05 +0000 (16:19 -0500)]
device_id: remove debug trace

for common case where a device id type is not used.

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