]> sourceware.org Git - lvm2.git/log
lvm2.git
2 years agoMove nolocking warning to man page
David Teigland [Fri, 25 Mar 2022 20:43:53 +0000 (15:43 -0500)]
Move nolocking warning to man page

It's more logical to warn about --nolocking in the man page
before it's used rather than after it's used and too late.
Also, warnings are usually for things the user may not know.

2 years agovgchange monitor: don't use udev info
David Teigland [Fri, 25 Mar 2022 19:13:56 +0000 (14:13 -0500)]
vgchange monitor: don't use udev info

vgchange --monitor y is run during startup when udev is being
initialized and is not yet ready to be used.

2 years agopvscan: don't use udev for external device info
David Teigland [Wed, 9 Mar 2022 17:54:59 +0000 (11:54 -0600)]
pvscan: don't use udev for external device info

pvscan is used to populate udev info, so it can't expect
to use that udev info.

2 years agowritecache: check memory usage
David Teigland [Tue, 1 Mar 2022 20:31:39 +0000 (14:31 -0600)]
writecache: check memory usage

warn if writecache neds > 50% of system memory, and
confirm if writecache needs > 90% of system memory.

2 years agodevices: only close PVs on LVs when scan_lvs is enabled
David Teigland [Tue, 1 Mar 2022 18:22:46 +0000 (12:22 -0600)]
devices: only close PVs on LVs when scan_lvs is enabled

This code is only needed when lvm scans PVs that are stacked on LVs.

2 years agodevices: use dev-cache aliases handling from label scan functions
David Teigland [Mon, 28 Feb 2022 23:37:12 +0000 (17:37 -0600)]
devices: use dev-cache aliases handling from label scan functions

The label scan functions where doing some device alias validation
which is now better handled by the dev-cache layer, so just use
that.

2 years agodevices: fix dev_name assumptions
David Teigland [Tue, 22 Feb 2022 21:03:11 +0000 (15:03 -0600)]
devices: fix dev_name assumptions

dev_name(dev) returns "[unknown]" if there are no names
on dev->aliases.  It's meant mainly for log messages.

Many places assume a valid path name is returned, and
use it directly.  A caller that wants to use the path
from dev_name() must first check if the dev has any
paths with dm_list_empty(&dev->aliases).

2 years agodevices: initial use of existing option
David Teigland [Thu, 24 Feb 2022 22:10:37 +0000 (16:10 -0600)]
devices: initial use of existing option

Use dev_cache_get_existing() in a few common, high level
locations where it's obvious that only existing dev-cache
entries are wanted.  This can be expanded and used in more
locations (or dev_cache_get can stop creating new entries.)

2 years agodevices: drop incorrect paths from aliases list
David Teigland [Thu, 24 Feb 2022 22:03:21 +0000 (16:03 -0600)]
devices: drop incorrect paths from aliases list

along with some basic checks for cases when a device
has no aliases.

lvm itself creates many situations where a struct device
has no valid paths, when it activates and opens an LV,
does something with it, e.g. zeroing, and then closes
and deactivates it.  (dev-cache is intended for PVs, and
the use of LVs should be moved out of dev-cache in a
future patch.)

2 years agodevices: simplify dev_cache_get_by_devt
David Teigland [Thu, 24 Feb 2022 21:57:29 +0000 (15:57 -0600)]
devices: simplify dev_cache_get_by_devt

remove unused args, and no callers need or want a
repeated dev_cache_scan if there is no dev from the
lookup.

2 years agowritecache: display block size from lvs
David Teigland [Mon, 21 Feb 2022 22:09:57 +0000 (16:09 -0600)]
writecache: display block size from lvs

lvs was missing the ability to display writecache block size.
now possible with lvs -o writecache_block_size

2 years agoman lvmcache: mention writecache memory usage
David Teigland [Mon, 21 Feb 2022 17:35:58 +0000 (11:35 -0600)]
man lvmcache: mention writecache memory usage

2 years agoman: update cachesettings option description
David Teigland [Wed, 16 Feb 2022 21:36:44 +0000 (15:36 -0600)]
man: update cachesettings option description

to be more consistent with man page description

2 years agoman lvmcache: add more writecache cachesettings info
David Teigland [Wed, 16 Feb 2022 21:21:09 +0000 (15:21 -0600)]
man lvmcache: add more writecache cachesettings info

2 years agodev_manager: use list info for preset devs
Zdenek Kabelac [Tue, 15 Feb 2022 23:33:32 +0000 (00:33 +0100)]
dev_manager: use list info for preset devs

In some cases we can also use cached info obtained from DM_DEVICE_LIST
also to avoid extra ioctl check for present devices.

2 years agodev_manager: do not query for open_count
Zdenek Kabelac [Fri, 11 Feb 2022 22:55:08 +0000 (23:55 +0100)]
dev_manager: do not query for open_count

Oepn count is not used along this code path.

2 years agoclang: possible better compilation with musl c
Zdenek Kabelac [Tue, 15 Feb 2022 23:48:49 +0000 (00:48 +0100)]
clang: possible better compilation with musl c

Try to help resolving reported compilation problem with
clang & musl C.
https://github.com/lvmteam/lvm2/issues/61

2 years agoclang: add extra check
Zdenek Kabelac [Tue, 8 Feb 2022 18:17:30 +0000 (19:17 +0100)]
clang: add extra check

Make clang happier.

2 years agodev_manager: failing status is not internal error
Zdenek Kabelac [Tue, 15 Feb 2022 20:16:10 +0000 (21:16 +0100)]
dev_manager: failing status is not internal error

Different target type for LV it's not an internal error.
i.e.  when target type is replaced with 'error' type - it should be
reported as regular warning and not cause interruption of command with
internall error.

2 years agodev_manager: fix dm_task_get_device_list
Zdenek Kabelac [Tue, 15 Feb 2022 23:33:25 +0000 (00:33 +0100)]
dev_manager: fix dm_task_get_device_list

With very old version of DM target driver we have to avoid
trying to use newuuid setting - otherwise we get error
during ioctl preparation phase.

Patch is fixing regression from commit:
988ea0e94c79a496f2619eab878fd9db6168711d

2 years agotests: skip vgchange-pvs-online.sh on rhel5
David Teigland [Tue, 15 Feb 2022 21:56:01 +0000 (15:56 -0600)]
tests: skip vgchange-pvs-online.sh on rhel5

the /dev/mapper/ paths to test devices don't seem to work there

2 years agodevices file: do not clear PVID of unread devices
David Teigland [Thu, 10 Feb 2022 20:00:25 +0000 (14:00 -0600)]
devices file: do not clear PVID of unread devices

In a certain disconnected state, a block device is present on
the system, can be opened, reports a valid size, reports the
correct device id (wwid), and matches a devices file entry.
But, reading the device can still fail.  In this case,
device_ids_validate() was misinterpreting the read error as
the device having no data/label on it (and no PVID).
The validate function would then clear the PVID from the
devices file entry for the device, thinking that it was
fixing the devices file (making it consistent with the on disk
state.)  Fix this by not attempting to check and correct a
devices file entry that cannot be read.  Also make this case
explicit in the hints validation code (which was doing the
right thing but indirectly.)

2 years agotests: udev-pvscan-vgchange fix service wait
David Teigland [Mon, 7 Feb 2022 22:44:57 +0000 (16:44 -0600)]
tests: udev-pvscan-vgchange fix service wait

As a result of removing -r from systemd-run in
commit fbd8b0cf43dc67f51f86f060dce748f446985855
this test needs to change how it handles the
transient services.

2 years agomake: generate
Zdenek Kabelac [Sun, 6 Feb 2022 19:05:54 +0000 (20:05 +0100)]
make: generate

2 years agoasan: fix some reports from libasan
Zdenek Kabelac [Mon, 7 Feb 2022 18:58:04 +0000 (19:58 +0100)]
asan: fix some reports from libasan

When compiled and used with:

CFLAGS="-fsanitize=address -g -O0"
ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1

we have few reported issue - they where not normally spotted, since
we were still accessing our own memory - but ouf of buffer-range.

TODO: there is still something to enhance with handling of #orphan vgids

2 years agopost-release
Marian Csontos [Mon, 7 Feb 2022 17:02:07 +0000 (18:02 +0100)]
post-release

2 years agopre-release v2_03_15
Marian Csontos [Mon, 7 Feb 2022 17:00:54 +0000 (18:00 +0100)]
pre-release

2 years agotests: devicesfile-edit
David Teigland [Thu, 3 Feb 2022 22:58:12 +0000 (16:58 -0600)]
tests: devicesfile-edit

test lvmdevices add/del

2 years agolvmdevices: make deldev work for missing device
David Teigland [Thu, 3 Feb 2022 22:56:03 +0000 (16:56 -0600)]
lvmdevices: make deldev work for missing device

2 years agowritecache: look for settings in lvm.conf
David Teigland [Mon, 31 Jan 2022 22:12:24 +0000 (16:12 -0600)]
writecache: look for settings in lvm.conf

Restore the lvm.conf cache_settings for writecache
added by c6639056e0bb2fc5f072b2c0d6bb629ad17eee6e.
Shorter method reduces and isolates the complexity
of config trees.

2 years agoRevert "writecache: handle options from lvm.conf"
David Teigland [Mon, 31 Jan 2022 21:18:46 +0000 (15:18 -0600)]
Revert "writecache: handle options from lvm.conf"

This reverts commit c6639056e0bb2fc5f072b2c0d6bb629ad17eee6e.

Next commit restores this feature.

2 years agotests: skip test part when missed in kernel
Zdenek Kabelac [Mon, 31 Jan 2022 14:11:47 +0000 (15:11 +0100)]
tests: skip test part when missed in kernel

2 years agoactivation: use lv_is_active
Zdenek Kabelac [Sun, 30 Jan 2022 14:30:48 +0000 (15:30 +0100)]
activation: use lv_is_active

Use existing lv_is_active

2 years agotools: missing sync after deactivation
Zdenek Kabelac [Fri, 28 Jan 2022 16:42:04 +0000 (17:42 +0100)]
tools: missing sync after deactivation

Caching of DM states optimisation revealed some missing
synchronisation points.

2 years agoudev: create symlinks and watch even in suspended state
Martin Wilck [Fri, 28 Jan 2022 13:42:29 +0000 (14:42 +0100)]
udev: create symlinks and watch even in suspended state

If a dm device is suspended, we can't run blkid on it. But earlier
rules (e.g. 11-dm-parts.rules) might have imported previously scanned
properties from the udev db, in particular if the device had been correctly
set up beforehand (DM_UDEV_PRIMARY_SOURCE_FLAG==1). Symlinks for existing
ID_FS_xyz properties must be preserved in this case. Otherwise lower-priority
devices (such as multipath components) might take over the symlink
temporarily.

Likewise, we should't stop watching a temporarily suspended, but previously
correctly configured dm device.

Signed-off-by: Martin Wilck <mwilck@suse.com>
2 years agoremove static autoactivation
David Teigland [Tue, 25 Jan 2022 22:05:32 +0000 (16:05 -0600)]
remove static autoactivation

event based autoactivation is now the only method that lvm
provides for autoactivation.

Setting lvm.conf event_activation=0 can still be used to disable
event based autoactivation commands, but doing so will no longer
enable static autoactivation.

2 years agotest: remove leaked exit
Zdenek Kabelac [Wed, 26 Jan 2022 14:32:30 +0000 (15:32 +0100)]
test: remove leaked exit

2 years agogcc: increate buffer sizes
Zdenek Kabelac [Thu, 20 Jan 2022 14:27:29 +0000 (15:27 +0100)]
gcc: increate buffer sizes

Make all possible string buffers to fit so they are not shortened in the
middle.

2 years agogcc: snprintf may need here upto 18 bytes
Zdenek Kabelac [Thu, 20 Jan 2022 14:24:09 +0000 (15:24 +0100)]
gcc: snprintf may need here upto 18 bytes

Although hypothetical case....

2 years agolvcreate: code move
Zdenek Kabelac [Tue, 18 Jan 2022 16:33:53 +0000 (17:33 +0100)]
lvcreate: code move

2 years agotest: check writecache profile support
Zdenek Kabelac [Mon, 24 Jan 2022 13:49:53 +0000 (14:49 +0100)]
test: check writecache profile support

FIXME

2 years agoman: doc writecache profile support
Zdenek Kabelac [Mon, 24 Jan 2022 13:50:09 +0000 (14:50 +0100)]
man: doc writecache profile support

2 years agolvcreate: cachesettings works also with writecache
Zdenek Kabelac [Tue, 18 Jan 2022 18:06:21 +0000 (19:06 +0100)]
lvcreate: cachesettings works also with writecache

2 years agolvcreate: fix crash for unspecified LV name for writecache
Zdenek Kabelac [Thu, 20 Jan 2022 15:01:17 +0000 (16:01 +0100)]
lvcreate: fix crash for unspecified LV name for writecache

Fix aplication crash when creating writecached LV with 'automatic' name.

2 years agowritecache: handle options from lvm.conf
Zdenek Kabelac [Thu, 20 Jan 2022 14:36:14 +0000 (15:36 +0100)]
writecache: handle options from lvm.conf

User can place default settings into lvm.conf i.e.:

allocation {
cache_settings {
writecache {
block_size = 4096
}
}
}

2 years agolvmdevices: fix checks when adding entries
David Teigland [Tue, 25 Jan 2022 17:35:36 +0000 (11:35 -0600)]
lvmdevices: fix checks when adding entries

Removes some incorrect and unnecessary checks for other entries
when adding a new devices.  The removed checks and corrections were
mostly redundant with what is already done by device id matching.
Other checking is reworked so the warnings are a bit different.

2 years agodevice_id: fix search for renamed device when the wwid is ignored
David Teigland [Tue, 25 Jan 2022 16:47:50 +0000 (10:47 -0600)]
device_id: fix search for renamed device when the wwid is ignored

When a device has a wwid (from sysfs), but lvm ignores the wwid,
e.g. because it contains an unreliable "QEMU" value, then lvm
falls back to using IDTYPE=devname (the device name) as the
device id.  If the device name changes after reboot, then lvm
automatically searches for the PV on other devices to find the
new device name and correct system.devices.  When searching for
the PV, lvm skips looking at devices that would use other id types,
e.g. if a device would use a wwid and not a devname, then it
skips checking it.  However, it failed to account for the fact
that a device may have wwid that was ignored, in which case it
should be checked.

2 years agoRevert "pvcreate: overwrite partition header with -f"
David Teigland [Tue, 18 Jan 2022 18:15:03 +0000 (12:15 -0600)]
Revert "pvcreate: overwrite partition header with -f"

This reverts commit d5a950ca67c106403054ecb847e226e8b5a7c30e.

This commit did not properly recognize GPT cases.

2 years agolvmdevices check: error exit if update is needed
David Teigland [Thu, 13 Jan 2022 20:52:54 +0000 (14:52 -0600)]
lvmdevices check: error exit if update is needed

. error exit means that lvmdevices --update would make a change.

. remove check of PART field from --check because it isn't used.

. unlink searched_devnames file to ensure check|update will search

2 years agopvcreate: overwrite partition header with -f
David Teigland [Wed, 8 Sep 2021 21:30:11 +0000 (16:30 -0500)]
pvcreate: overwrite partition header with -f

$ pvcreate /dev/sdc
  Cannot use /dev/sdc: device is partitioned
$ pvcreate -f /dev/sdc
  Physical volume "/dev/sdc" successfully created.

2 years agoremove unused variable
David Teigland [Thu, 13 Jan 2022 17:41:09 +0000 (11:41 -0600)]
remove unused variable

resulting from commit cb798ee1c102aadde93965a894c5aa59d4e76e4a
  "lvmcache: remove lvmcache_update_vg_from_write"

2 years agohandle duplicate vgids
David Teigland [Thu, 6 Jan 2022 16:15:16 +0000 (10:15 -0600)]
handle duplicate vgids

The approach to duplicate VGIDs has been that it is not possible
or not allowed, so the behavior has been undefined.  The actual
result was unpredictable and/or broken, and generally unhelpful.

Improve this by recognizing the problem, displaying the VGs,
and printing a warning to fix the problem.  Beyond this,
using VGs with duplicate VGIDs remains undefined, but should
work well enough to correct the problem with vgchange -u.

It's possible to create this condition without too much difficulty
by cloning PVs, followed by an incomplete attempt at making the two
VGs unique (vgrename and pvchange -u, but missing vgchange -u.)

2 years agolvmcache: remove lvmcache_update_vg_from_write
David Teigland [Wed, 12 Jan 2022 22:46:26 +0000 (16:46 -0600)]
lvmcache: remove lvmcache_update_vg_from_write

After a vg_write, this function was used to attempt to
make lvmcache data match the new state written to disk.
It was not updated correctly in a many or most cases,
and the resulting lvmcache is not actually used after
vg_write, making the update unnecessary.

2 years agovgsplit: don't reread vg_to
David Teigland [Wed, 12 Jan 2022 22:42:01 +0000 (16:42 -0600)]
vgsplit: don't reread vg_to

The destination vg is first written with the EXPORTED flag,
then the source vg is written, then the destination vg is
written again without the EXPORTED flag.  Remove an unnecessary
vg_read of the destination vg just before the second write.

2 years agoRevert "handle duplicate vgids"
David Teigland [Tue, 11 Jan 2022 22:03:07 +0000 (16:03 -0600)]
Revert "handle duplicate vgids"

This reverts commit bd2baeaaa67da3885df9f06700565dc201c82861.

This commit broke vgrename because vgrename relies on old bugs
in lvmcache_update_vg_from_write and lvmcache_update_vgname
which need to be fixed first.

2 years agohandle duplicate vgids
David Teigland [Thu, 6 Jan 2022 16:15:16 +0000 (10:15 -0600)]
handle duplicate vgids

The approach to duplicate VGIDs has been that it is not possible
or not allowed, so the behavior has been undefined.  The actual
result was unpredictable and/or broken, and generally unhelpful.

Improve this by recognizing the problem, displaying the VGs,
and printing a warning to fix the problem.  Beyond this,
using VGs with duplicate VGIDs remains undefined, but should
work well enough to correct the problem with vgchange -u.

It's possible to create this condition without too much difficulty
by cloning PVs, followed by an incomplete attempt at making the two
VGs unique (vgrename and pvchange -u, but missing vgchange -u.)

2 years agolvmlockd: cleanup after sanlock_rem_lockspace error
David Teigland [Tue, 4 Jan 2022 20:47:31 +0000 (14:47 -0600)]
lvmlockd: cleanup after sanlock_rem_lockspace error

When storage is lost under a sanlock VG, and kill_vg/drop_vg
are used, sanlock_rem_lockspace() may return an error, but
the cleanup steps should still be performed.  Without the
cleanup, gl_lsname_sanlock was not cleared.  This caused
future lock requests to fail with ENOLS, but the NO_GL_LS
flag was not set due to gl_lsname_sanlock being set.
This caused lockd_global(sh) in lvm commands to fail when
they could succeed.

Fix from guozhonghua216

2 years agolabel: cache dm device list
Zdenek Kabelac [Wed, 15 Dec 2021 10:45:22 +0000 (11:45 +0100)]
label: cache dm device list

Since we check for present DM devices - cache result for
futher use of checking presence of such device.

lvm2 uses cache result for label scan, but also when
it tries to activate or deactivate LV - however only simple
target 'striped' is reasonably supported.

Use disable_dm_devs to be able to control when lv_info()
get cache or uncached results.

TODO: support more type, however this is getting very complicated.

2 years agoactivate: add get_device_list
Zdenek Kabelac [Wed, 15 Dec 2021 10:24:31 +0000 (11:24 +0100)]
activate: add get_device_list

Add funtion get_device_list() to get list of active DM devices.
Handled through new dm_task_get_device_list().

2 years agodevicemapper: add dm_task_get_device_list
Zdenek Kabelac [Wed, 15 Dec 2021 10:34:50 +0000 (11:34 +0100)]
devicemapper: add dm_task_get_device_list

New API extension (internal ATM) for getting a list
of active DM device with extra features like i.e. uuid.

To easily lookout for existing UUID in device list,
there is: dm_device_list_find_by_uuid()

Once the returned structure is no longer usable call:
dm_device_list_destroy()

Struct dm_active_device {} holds all the info,
but is always allocated and destroyed within library.

TODO: once it's stable, copy to libdm

2 years agolibdm: unmangling UUID for DM_DEVICE_LIST
Zdenek Kabelac [Wed, 8 Dec 2021 09:45:13 +0000 (10:45 +0100)]
libdm: unmangling UUID for DM_DEVICE_LIST

Properly unmangle UUID if they are provided as result
of DM_DEVICE_LIST ioctl on newer linux kernels.

2 years agoactivate: device_is_usable
Zdenek Kabelac [Wed, 15 Dec 2021 10:26:21 +0000 (11:26 +0100)]
activate: device_is_usable

Move checking of usable uuid into separate function
and pass in also cmd context.

2 years agolvmcmdline: comment reset of configuration settings
Zdenek Kabelac [Fri, 17 Dec 2021 15:41:54 +0000 (16:41 +0100)]
lvmcmdline: comment reset of configuration settings

We used to reset 'settings' to their defaults after command is finished.
This however has a drawback we lose all the logging after this point.

So this patch disables this 'reset' to observe for side-effects.

lvm shell should be getting reset when next command is run -
so this might or might not have some 'hidden' effects.

ATM it looks like nothing really bad should happen - we just should be
able to get more logs - at least from normal commands.

2 years agolibdm: correct version check
Zdenek Kabelac [Wed, 8 Dec 2021 09:56:21 +0000 (10:56 +0100)]
libdm: correct version check

If there ever would be API version 5,
these check would give incorrect results.

2 years agoactivate: cache driver_version result
Zdenek Kabelac [Wed, 8 Dec 2021 09:25:02 +0000 (10:25 +0100)]
activate: cache driver_version result

2 years agotoolcontext: reuse destroy_config_context
Zdenek Kabelac [Fri, 10 Dec 2021 19:51:46 +0000 (20:51 +0100)]
toolcontext: reuse destroy_config_context

Call existing destroy_config_context() to destroy
some parts of cmd_context.

2 years agohash: raise hash table size
Zdenek Kabelac [Fri, 17 Dec 2021 15:36:36 +0000 (16:36 +0100)]
hash: raise hash table size

With slightly bigger hash tables, there is considerable
less hash collisions.

2 years agotoollib: avoid repeated remove of online vg
Zdenek Kabelac [Fri, 17 Dec 2021 12:18:56 +0000 (13:18 +0100)]
toollib: avoid repeated remove of online vg

Call just once unlink after every deactivation of LV from VG.

2 years agovdo: ensure VDO config is removed
Andrew Walsh [Mon, 15 Nov 2021 15:49:06 +0000 (10:49 -0500)]
vdo: ensure VDO config is removed

Make sure to remove the VDO config after conversion
of LVM-backed VDO.

Addresses point 3 in rhbz#1987024#c5

2 years agoman lvmautoactivation: replace systemctl with journalctl
David Teigland [Tue, 14 Dec 2021 18:02:08 +0000 (12:02 -0600)]
man lvmautoactivation: replace systemctl with journalctl

2 years agoudev: remove -r from systemd-run
David Teigland [Tue, 14 Dec 2021 17:57:13 +0000 (11:57 -0600)]
udev: remove -r from systemd-run

If the transient service remains after it's done, then
it prevents the same transient service from being run
again later if the PVs are detached and reattached
(although the behavior of a second autoactivation is not
well defined and may only work in limited cases.)

2 years agodevices: recognise rbd (ceph rados block device)
наб [Mon, 13 Dec 2021 19:32:06 +0000 (13:32 -0600)]
devices: recognise rbd (ceph rados block device)

Description stolen from linux d/b/rbd.c L3:
  rbd.c -- Export ceph rados objects as a Linux block device

16 partitions seem to make sense according to L90:
  #define RBD_SINGLE_MAJOR_PART_SHIFT 4

Running *scan -vvvvvvdddddd yields
  #filters/filter-type.c:28            /dev/rbd1p5: Skipping: Unrecognised LVM device type 252
  #filters/filter-persistent.c:131           filter caching bad /dev/rbd1p5
right now, and adding
  types = ["rbd", 252]
to /e/l/lvm.conf (with the matching "252 rbd" in /p/devices) works as a
per-machine fix:
  rbd1               252:16   0      1T  1 disk
  |-rbd1p1           252:17   0    243M  1 part
  |-rbd1p2           252:18   0      1K  1 part
  `-rbd1p5           252:21   0 1023.8G  1 part
    `-dev01--vg-root 253:0    0 1023.8G  0 lvm
but rbd is supported by upstream so it'd be nice to have it work OOB

2 years agolvcreate: include recent options
David Teigland [Mon, 13 Dec 2021 14:59:31 +0000 (08:59 -0600)]
lvcreate: include recent options

The permitted option list in lvcreate has not kept
up with command-lines.in.

2 years agoman: add section about static autoactivation
David Teigland [Mon, 6 Dec 2021 19:20:32 +0000 (13:20 -0600)]
man: add section about static autoactivation

2 years agodevice_id: handle wwid with spaces or control characters
David Teigland [Thu, 2 Dec 2021 19:30:36 +0000 (13:30 -0600)]
device_id: handle wwid with spaces or control characters

non-standard wwid can be reported from sysfs with spaces/etc.
replace with "_"

2 years agoprint warning about unrecognized journal option value
David Teigland [Thu, 2 Dec 2021 18:40:52 +0000 (12:40 -0600)]
print warning about unrecognized journal option value

2 years agopvscan: fix error message for invalid devname
David Teigland [Wed, 1 Dec 2021 20:36:40 +0000 (14:36 -0600)]
pvscan: fix error message for invalid devname

uninitialized name buffer used in message.
fixes "pvs_online: include devname in pvid files"

2 years agopvscan: fix filter symlink checks
David Teigland [Wed, 1 Dec 2021 19:40:09 +0000 (13:40 -0600)]
pvscan: fix filter symlink checks

Fixes commit "pvscan: match device arg to filter symlink"
which failed to account for the fact that filter entries
are not just path names but include "a" or "r", etc.

2 years agodevices file: don't write in test mode
David Teigland [Wed, 1 Dec 2021 16:08:08 +0000 (10:08 -0600)]
devices file: don't write in test mode

2 years agotests devicesfile-devname.sh drop mdadm chunk
David Teigland [Wed, 1 Dec 2021 14:56:05 +0000 (08:56 -0600)]
tests devicesfile-devname.sh drop mdadm chunk

2 years agospec: Add lvmautoactivation man page
Marian Csontos [Wed, 1 Dec 2021 14:35:40 +0000 (15:35 +0100)]
spec: Add lvmautoactivation man page

2 years agopvscan: limit md device_hint for slow autoactivation
David Teigland [Tue, 30 Nov 2021 15:06:08 +0000 (09:06 -0600)]
pvscan: limit md device_hint for slow autoactivation

The device_hint name in the metadata was meant to prevent
autoactivation from md components, but the name checks were
more general and would catch unnecessary cases.

2 years agopvscan: match device arg to filter symlink
David Teigland [Mon, 29 Nov 2021 23:13:44 +0000 (17:13 -0600)]
pvscan: match device arg to filter symlink

This fixes an issue related to the optimization in
  "pvscan: only add device args to dev cache"

If the devices file is not used, and the lvm.conf filter
accepts devices via symlink names, then those devices won't
be accepted by pvscan for autoactivation.  To resolve this,
recognize when the filter contains symlinks and disable the
optimization.  When the optimization is disabled, a full
dev_cache_scan is performed, and symlinks are associated
with the device names passed to pvscan.  filter-regex
will accept a device if symlinks to that device are accepted.

2 years agoman: lvmautoactivation
David Teigland [Wed, 24 Nov 2021 22:03:39 +0000 (16:03 -0600)]
man: lvmautoactivation

new topical man page describing autoactivation

2 years agodevices: exclude md components when duplicate pvs are seen
David Teigland [Mon, 22 Nov 2021 21:10:43 +0000 (15:10 -0600)]
devices: exclude md components when duplicate pvs are seen

Improve handling of md components that get through the
filter, like the previous improvement for multipath.
If md components get through the filter and trigger
duplicate PV code, then eliminate any devs entirely
that are not an md device.

2 years agofix spelling of pruning
David Teigland [Fri, 19 Nov 2021 18:02:35 +0000 (12:02 -0600)]
fix spelling of pruning

2 years agodevices: exclude multipath components based on matching wwid
David Teigland [Wed, 17 Nov 2021 23:10:45 +0000 (17:10 -0600)]
devices: exclude multipath components based on matching wwid

If multipath component devices get through the filter and
cause lvm to see duplicate PVs, then check the wwid of the
devs and drop the component devices as if they had been
filtered.  If a dm mpath device was found among the duplicates
then use that as the PV, otherwise do not use any of the
components as the PV.

"duplicate PVs" associated with multipath configs will no
longer stop commands from working.

2 years agodisplay: ignore --reportformat
David Teigland [Wed, 17 Nov 2021 16:40:27 +0000 (10:40 -0600)]
display: ignore --reportformat

Using the option would do nothing useful but would
print extraneous braces.

2 years agoRevert "tests devicesfile-devname: remove searched_devnames"
David Teigland [Tue, 16 Nov 2021 20:30:09 +0000 (14:30 -0600)]
Revert "tests devicesfile-devname: remove searched_devnames"

This reverts commit 8e61c0ad6ecad5e0bcee09e44029e39396c1b59a.

The changes from "device_id: searched_devnames improvements"
allow this to work without the external removal.

2 years agotests pv-ext-flags: work with devices file
David Teigland [Tue, 16 Nov 2021 20:21:07 +0000 (14:21 -0600)]
tests pv-ext-flags: work with devices file

2 years agodevice_id: searched_devnames improvements
David Teigland [Tue, 16 Nov 2021 17:26:41 +0000 (11:26 -0600)]
device_id: searched_devnames improvements

Remove the searched_devnames file in a couple more places:
. When hints need refreshing it's possible that a missing
  devices file entry could be found by searching devices
  again.
. When a devices file entry devname is first found to be
  incorrect, a new search for missing entries may be
  useful.

2 years agodevice_id: fix search on filtered device
David Teigland [Tue, 16 Nov 2021 15:29:24 +0000 (09:29 -0600)]
device_id: fix search on filtered device

When devnames are used as device ids and devnames change,
then new devices need to be located for the PVs.  If the old
devname is now used by a filtered device, this was preventing
the code from searching for the new device, so the PV was
reported as missing.

2 years agotests devicesfile-devname: remove searched_devnames
David Teigland [Tue, 16 Nov 2021 00:04:10 +0000 (18:04 -0600)]
tests devicesfile-devname: remove searched_devnames

remove /run/lvm/searched_devnames when preparing each test
in case it has appeared on the system

2 years agovgchange autoactivation: error path cleanup
David Teigland [Fri, 12 Nov 2021 22:46:39 +0000 (16:46 -0600)]
vgchange autoactivation: error path cleanup

If the optimized label scan fails (using online files),
then clear the device state prior to falling back to the
standard label_scan.  This avoids printing output about
unexpected state.

2 years agodevice_id: match different dm device names
David Teigland [Fri, 12 Nov 2021 22:42:51 +0000 (16:42 -0600)]
device_id: match different dm device names

If a devices file entry for a dm device is using the devname
for the device id, then recognize different dm names as matching.

2 years agotests: udev-pvscan-vgchange clear services
David Teigland [Fri, 12 Nov 2021 18:10:26 +0000 (12:10 -0600)]
tests: udev-pvscan-vgchange clear services

2 years agoonline files: fix vgname check
David Teigland [Fri, 12 Nov 2021 17:52:36 +0000 (11:52 -0600)]
online files: fix vgname check

The pvs_online file for a PV will not contain a vgname
if the PV has no metadata, so don't require matching
vgname with the pvs_lookup file.

2 years agopvscan: consistent creation of pvs_lookup file
David Teigland [Fri, 12 Nov 2021 16:06:54 +0000 (10:06 -0600)]
pvscan: consistent creation of pvs_lookup file

Consistently create the pvs_lookup file for VGs with
more than one PV.  Previously the file create would be
skipped if all the PVs happened to already be online.
That led to unpredicatable results in an uncommon case
(when the last PV to come online is the only PV with
metadata.)

2 years agotests vgchange-pvs-online: clean up with devices file
David Teigland [Thu, 11 Nov 2021 22:38:10 +0000 (16:38 -0600)]
tests vgchange-pvs-online: clean up with devices file

changing the dev names resulted in stale devices file
entries that created noise in the output.

2 years agotests: udev-pvscan-vgchange fix wait
David Teigland [Thu, 11 Nov 2021 22:04:24 +0000 (16:04 -0600)]
tests: udev-pvscan-vgchange fix wait

the service now remains after completion

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