]> sourceware.org Git - lvm2.git/log
lvm2.git
20 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().

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

20 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

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

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

21 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

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

21 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

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

21 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

22 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

22 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

22 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

22 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

22 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

22 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

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

22 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

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

22 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

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

22 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

22 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

22 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

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

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

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

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

Rephrase.

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

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

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

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

23 months 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

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

23 months 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)

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

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

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

23 months 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@.

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

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

23 months agocmd: save device_id_sysfs_dir
David Teigland [Mon, 24 Oct 2022 21:15:53 +0000 (16:15 -0500)]
cmd: save device_id_sysfs_dir

read and save device_id_sysfs_dir to avoid spamming
debug output from find_config_tree_str.

23 months agolvmdbusd: Handle PV signature copy
Tony Asleson [Thu, 20 Oct 2022 15:46:51 +0000 (10:46 -0500)]
lvmdbusd: Handle PV signature copy

If something manually copies a PV signature to a block device we will
miss it.  Handle this case too.

23 months agolvmdbustest: Add test for copy signature
Tony Asleson [Thu, 20 Oct 2022 17:48:40 +0000 (12:48 -0500)]
lvmdbustest: Add test for copy signature

Add test to ensure we detect when a PV signature is copied to a block
device.

23 months agolvmdbusd: Always leverage udev
Tony Asleson [Tue, 18 Oct 2022 17:30:09 +0000 (12:30 -0500)]
lvmdbusd: Always leverage udev

Previously we utilized udev until we got a dbus notification from lvm
command line tools.  This however misses the case where something outside
of lvm clears the signatures on a block device and we fail to refresh the
state of the daemon.  Change the behavior so we always monitor udev events,
but ignore those udev events that pertain to lvm members.

Note: --udev command line option no longer does anything and simply
outputs a message that it's no longer used.

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

23 months agolvmdbustest: Add test for wipefs
Tony Asleson [Tue, 18 Oct 2022 17:26:14 +0000 (12:26 -0500)]
lvmdbustest: Add test for wipefs

Ensure that if an external program or user calles wipefs on a PV that we
correctly update the state of the daemon.

23 months agolvmnotify.c: Check to see if dbus daemon is running
Tony Asleson [Wed, 19 Oct 2022 17:46:45 +0000 (12:46 -0500)]
lvmnotify.c: Check to see if dbus daemon is running

The lvm dbus daemon will auto activate on dbus API calls.  To
prevent the dbus daemon starting when lvm command line tools are
being used we will check to see if the daemon is running first.
If the daemon is not running, we will not notify the daemon.

For this check to work it requires the changes done previously
with commit: 3fdf4493481ff8baae2ac5416dce6d05b69e6b28

Reviewed-by: David Teigland <teigland@redhat.com>
2 years agolvreduce: change error message about --fs options
David Teigland [Wed, 12 Oct 2022 15:05:14 +0000 (10:05 -0500)]
lvreduce: change error message about --fs options

2 years agolvmlockd: Fix sanlock lvmlock lv size calculation
corubba [Wed, 12 Oct 2022 14:19:01 +0000 (09:19 -0500)]
lvmlockd: Fix sanlock lvmlock lv size calculation

The number of extents for the sanlock lvmlock lv is calculated using
integer division, which rounds towards zero. With a physical extent size
of 129M, instead of the requested 256M the lv is only 129M (1 extent).
With any physical extent size greater than 256M the lv creation fails
because the number of extents is zero.

This is fixed by replacing the integer division with a division macro
that rounds up and thus guarantees that the size of the lv will always
be equal or greater than the requested size. Using the examples above, a
pes of 129M will result in a 258M lv (2 extents), pes of 300M in a 300M
lv (1 extent).

The re-calculation of the lv size in bytes and megabytes is only so the
debug output shows the correct values. The size in mb there is still
not byte-perfect-accurate, but good enough for a human-readable estimate;
and the exact size in bytes and extents is right next to it.

Signed-off-by: corubba <corubba@gmx.de>
2 years agotoollib: do not process just created historical LV
Peter Rajnoha [Wed, 12 Oct 2022 12:41:58 +0000 (14:41 +0200)]
toollib: do not process just created historical LV

When executing process_each_lv_in_vg, we process live LVs first and
after that, we process any historical LVs. In case we have just removed
an LV, which also means we have just made it "historical" and so it
appears as fresh item in vg->historical_lvs list, we have to skip it
when we get to processing historical LVs inside the same process_each_lv_in_vg
call.

The simplest approach here, without introducing another LV list, is to
simply mark such historical LVs as "fresh" directly in struct
historical_logical_volume when we have just removed the original LV
and created the historical LV for it. Then, we just need to check the
flag when processing historical LVs and skip it if it is "fresh".

When we read historical LVs out of metadata, they are marked as
"not fresh" and so they can be processed as usual.

This was mainly an issue in conjuction with -S|--select use:

#  lvmconfig --type diff
metadata {
record_lvs_history=1
}

(In this example, a thin pool with lvol1 thin LV and lvol2 and lvol3 snapshots.)

#  lvs -H vg -o name,pool_lv,full_ancestors,full_descendants
  LV    Pool FAncestors  FDescendants
  lvol1 pool             lvol2,lvol3
  lvol2 pool lvol1       lvol3
  lvol3 pool lvol2,lvol1
  pool

#  lvremove -S 'name=lvol2'
  Logical volume "lvol2" successfully removed.
  Historical logical volume "lvol2" successfully removed.

...here, the historical LV lvol2 should not have been removed because
we have just removed its original non-historical lvol2 and the fresh
historical lvol2 must not be included in the same processing spree.

2 years agolvreduce: require active LV when no fs option is used
David Teigland [Tue, 11 Oct 2022 16:50:47 +0000 (11:50 -0500)]
lvreduce: require active LV when no fs option is used

Without an --fs option set, make lvreduce of an inactive LV
fail and report that the LV must be active.

2 years agotests: add comments to fsadm-renamed
David Teigland [Tue, 11 Oct 2022 16:28:19 +0000 (11:28 -0500)]
tests: add comments to fsadm-renamed

to explain the what and why of the steps that are
not obvious

2 years agolvmlockd: fix warning
David Teigland [Tue, 11 Oct 2022 17:35:38 +0000 (12:35 -0500)]
lvmlockd: fix warning

2 years agotests: skip lvresize tests without mkfs.xfs
David Teigland [Mon, 10 Oct 2022 18:25:50 +0000 (13:25 -0500)]
tests: skip lvresize tests without mkfs.xfs

2 years agolvmdevices: use deviceidtype option strictly
David Teigland [Thu, 15 Sep 2022 14:45:21 +0000 (09:45 -0500)]
lvmdevices: use deviceidtype option strictly

Only use the device id type specified by --deviceidtype,
and fail if that type is not available for the device.

2 years agotests: device ids using vpd data
David Teigland [Tue, 20 Sep 2022 15:54:57 +0000 (10:54 -0500)]
tests: device ids using vpd data

2 years agodevice id: add new types using values from vpd_pg83
David Teigland [Wed, 31 Aug 2022 21:05:07 +0000 (16:05 -0500)]
device id: add new types using values from vpd_pg83

The new device_id types are: wwid_naa, wwid_eui, wwid_t10.
The new types use the specific wwid type in their name.
lvm currently gets the values for these types by reading
the device's vpd_pg83 sysfs file (this could change in the
future if better methods become available for reading the
values.)

If a device is added to the devices file using one of these
types, prior versions of lvm will not recognize the types
and will be unable to use the devices.

When adding a new device, lvm continues to first use sys_wwid
from the sysfs wwid file.  If the device has no sysfs wwid file,
lvm now attempts to use one of the new types from vpd_pg83.

If a devices file entry with type sys_wwid does not match a
given device's sysfs wwid file, the sys_wwid value will also
be compared to that device's other wwids from its vpd_pg83 file.
If the kernel changes the wwid type reported from the sysfs
wwid file, e.g. from a device's t10 id to its naa id, then lvm
should still be able to match it correctly using the vpd_pg83
data which will include both ids.

2 years agodevice id: change space handling in t10 wwid
David Teigland [Wed, 31 Aug 2022 20:59:28 +0000 (15:59 -0500)]
device id: change space handling in t10 wwid

t10 wwids are now edited in the same way that multipath does,
which is replacing a series of spaces with one _.  Previously
lvm replaced every space with one _.  Devices file entries
with the old form will be converted to the new shorter form.

2 years agodevice id wwid adjustments
David Teigland [Tue, 30 Aug 2022 20:10:52 +0000 (15:10 -0500)]
device id wwid adjustments

Move the functions handling dev wwids.

Add dev flags indicating that wwids have been read from
sysfs wwid file or sysfs vpd_pg83 file.  This can be
used to avoid rereading these.

Improve filter-mpath search for a device's wwid in
/etc/multipath/wwids, to avoid unnecessary rereading
of wwids from sysfs files.

Type 8 wwids from vpd_pg83 with naa or eui names should be
saved as those types.

2 years agolvmlockd: purge the lock resources left in previous lockspace
Lidong Zhong [Fri, 30 Sep 2022 08:34:51 +0000 (16:34 +0800)]
lvmlockd: purge the lock resources left in previous lockspace

If lvmlockd in cluster is killed accidently or any other reason, the
lock resources will become orphaned in the VG lockspace. When the
cluster manager tries to restart this daemon, the LVs will probably
become inactive because of resource schedule policy and thus the lock
resouce will be omited during the adoption process. This patch will
try to purge the lock resources left in previous lockspace, so the
following actions can work again.

2 years agolvresize: move the lockd_lv earlier
David Teigland [Fri, 30 Sep 2022 17:16:32 +0000 (12:16 -0500)]
lvresize: move the lockd_lv earlier

the lock should cover any potential activation,
not just the resizing changes

2 years agolvmdbusd: Correct env. variable
Tony Asleson [Fri, 30 Sep 2022 16:49:49 +0000 (11:49 -0500)]
lvmdbusd: Correct env. variable

Make this match the unit test expectation and the form we use for
other env. variables.

2 years agoblkid: fix BLKID_SUBLKS_FSINFO usage
David Teigland [Thu, 29 Sep 2022 20:25:32 +0000 (15:25 -0500)]
blkid: fix BLKID_SUBLKS_FSINFO usage

Use this flag for all fs info lookups, including BLOCK_SIZE,
if it is defined in blkid.h.

2 years agolvresize: give special advice to reiserfs users
David Teigland [Wed, 28 Sep 2022 16:52:40 +0000 (11:52 -0500)]
lvresize: give special advice to reiserfs users

2 years agolvresize: exclude new fs handling at build time
David Teigland [Wed, 28 Sep 2022 16:02:17 +0000 (11:02 -0500)]
lvresize: exclude new fs handling at build time

Exclude the new fs resizing capabilities at build time
(rather than run time) if the necessary libblkid features
are not available.  When excluded, all fs resizing options
are translated to resize_fsadm.  Accessing the new
features now requires rebuilding lvm if libblkid is
upgraded.

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