]> sourceware.org Git - lvm2.git/log
lvm2.git
17 months agomakefiles: allow using configure cppflags
Zdenek Kabelac [Sun, 12 Feb 2023 12:12:23 +0000 (13:12 +0100)]
makefiles: allow using configure cppflags

Configure defines 'CPPFLAGS' and we should use defined value
for compilation.

Reported-by: debian
17 months agomakefiles: use configured systemd library paths
Zdenek Kabelac [Sat, 11 Feb 2023 15:06:26 +0000 (16:06 +0100)]
makefiles: use configured systemd library paths

Use discovered/selected systemd library from configure.

17 months agoWHATS_NEW_DM: update
Zdenek Kabelac [Sun, 12 Feb 2023 22:50:09 +0000 (23:50 +0100)]
WHATS_NEW_DM: update

17 months agolibdm: match reactivation of sibling for snapshot
Zdenek Kabelac [Sun, 12 Feb 2023 22:53:18 +0000 (23:53 +0100)]
libdm: match reactivation of sibling for snapshot

Apply same code for libdm as in device_mapper dir from
commit c8a5948a71b041ae2cce03e1b3a9843f0fab023f.

17 months agolibdm: improve parallel create of control node
Zdenek Kabelac [Sun, 12 Feb 2023 22:44:43 +0000 (23:44 +0100)]
libdm: improve parallel create of control node

When two parallel commands would have tried to create our
/dev/mapper/control node at the same time, one of them could
actually fail even if the 2nd. command actually mknod()
this control node correctly.

So for EEXIST case add detection if the control node is ok.

This may possibly help with some race case in early boot.

17 months agofilesystem: use PATH_MAX for linux paths
Zdenek Kabelac [Sun, 12 Feb 2023 18:23:12 +0000 (19:23 +0100)]
filesystem: use PATH_MAX for linux paths

17 months agoconfigure: update
Zdenek Kabelac [Fri, 10 Feb 2023 20:30:57 +0000 (21:30 +0100)]
configure: update

17 months agoconfigure.ac: check for blkid when required
Zdenek Kabelac [Fri, 10 Feb 2023 20:31:07 +0000 (21:31 +0100)]
configure.ac: check for blkid  when required

We still need to support build without any blkid present,
so use PKG_CHECK_EXISTS() instead of direct failure
from PKG_CHECK_MODULES for too old version.

17 months agoWHATS_NEW: update
Zdenek Kabelac [Fri, 10 Feb 2023 19:51:46 +0000 (20:51 +0100)]
WHATS_NEW: update

17 months agoconfigure: update
Zdenek Kabelac [Fri, 10 Feb 2023 18:50:22 +0000 (19:50 +0100)]
configure: update

17 months agoconfigure.ac: support systemd-run binary path
Zdenek Kabelac [Fri, 10 Feb 2023 18:49:42 +0000 (19:49 +0100)]
configure.ac: support systemd-run binary path

Allow users to specify their path to systemd-run binary:

configure --with-systemd-run=/my/path/system-run

By defaults it autodetected in $PATH and fallbacks to:
/usr/bin/systemd-run.

17 months agoconfigure.ac: better blkid test
Zdenek Kabelac [Fri, 10 Feb 2023 18:19:31 +0000 (19:19 +0100)]
configure.ac: better blkid test

Previous commit e67ebc5c40948bcbea536fd407535009a76ede00 used incorrect check
for blkid version.
Fix it by always checking for at least version 2.24,
as we can't use older version anyway.
Added BLKID_SUBLKS_FSINFO is present in newer version.

17 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.

17 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.

17 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.

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

17 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.

17 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.

17 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.

17 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.

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

17 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.

17 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.

17 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.

17 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.

17 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.

17 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.

17 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().

17 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.

17 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

17 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.

17 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

18 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.

18 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

18 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.

18 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.

18 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().

18 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()

18 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.

18 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.

18 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.

18 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".

18 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"

18 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>.

18 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.

18 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.

18 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.

18 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.

18 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.

18 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.

18 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 '\'.

18 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.

18 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.

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

18 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.

18 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.

18 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.

18 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

18 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.

18 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)

18 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

18 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.

19 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

19 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.

19 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

19 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.

19 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.

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

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

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

19 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.

19 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.

19 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'.

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

19 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.

19 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.

19 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.

19 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.

20 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.

20 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

20 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

20 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

20 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

20 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

20 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

20 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.

20 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

20 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.

20 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

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

20 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

20 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

20 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

20 months 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>
20 months 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>
20 months agopost-release
Marian Csontos [Thu, 10 Nov 2022 13:21:57 +0000 (14:21 +0100)]
post-release

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

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

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

Rephrase.

20 months 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.

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