]> sourceware.org Git - lvm2.git/log
lvm2.git
3 years agolabel: check only with active device for rescan
Zdenek Kabelac [Sat, 27 Feb 2021 20:20:37 +0000 (21:20 +0100)]
label: check only with active device for rescan

When 'lv_info()' is called with &info structure,
the presence of node has to be checked from this structure.
Without this we were needlesly trying to look out 0:0 device.

3 years agotoolib: move sigint_caught
Zdenek Kabelac [Sat, 27 Feb 2021 18:22:11 +0000 (19:22 +0100)]
toolib: move sigint_caught

Move the check for catched signal to the loop front.
Currently not much usable - but we can improve it later.

3 years agoarchive: support interruption
Zdenek Kabelac [Fri, 26 Feb 2021 00:23:50 +0000 (01:23 +0100)]
archive: support interruption

When lvm2 calls archive() or backup() it can be useful to allow handling
break signal so the command can be interrupted at some consistent point.

Signal is accepted during processing these calls - and can be evaluated
later during even lengthy processing loops.

So now user can interrupt lengthy lvremove().

3 years agolvremove: backup at the end of loop
Zdenek Kabelac [Fri, 26 Feb 2021 00:01:29 +0000 (01:01 +0100)]
lvremove: backup at the end of loop

Taking backup with each removed LV is slowing down the process
considerable and is largerly uneeded. We are supposed to take
backup only on significant points and making sure the backup
is correct when the command is finished.

TODO: check how many other commands can be improved.

3 years agodev-cache: optimize dir scanning
Zdenek Kabelac [Sat, 27 Feb 2021 16:09:38 +0000 (17:09 +0100)]
dev-cache: optimize dir scanning

Use 'C' for alphasort - there is no need to use localized and slower
sorting for internal directory scanning.

Ensure on all code paths allocated dirent entries are released.

Optimize full path construction.

3 years agodev-cache: replace inefficient looking for dev
Zdenek Kabelac [Thu, 25 Feb 2021 23:21:41 +0000 (00:21 +0100)]
dev-cache: replace inefficient looking for dev

Use btree loopkup to find dev structure by major:minor.
This could have slow down lvm2 commands significantly with
higher amount of LVs.

3 years agocmdline: use binary search
Zdenek Kabelac [Thu, 25 Feb 2021 17:09:52 +0000 (18:09 +0100)]
cmdline: use binary search

Reduce strcmp() call count by using binary search to find
commands in cmd_names[] and command_names[] arrays.

3 years agocmdline: drop MAX and check NULL
Zdenek Kabelac [Thu, 25 Feb 2021 17:09:33 +0000 (18:09 +0100)]
cmdline: drop MAX and check NULL

Remove MAX_COMMAND_NAMES and check for the last element as NULL pointer.

3 years agocmdline: lvcreate adds vdopool as vg name provider
Zdenek Kabelac [Thu, 25 Feb 2021 16:41:39 +0000 (17:41 +0100)]
cmdline: lvcreate adds vdopool as vg name provider

Add same logic as with thinpool or cachepool.

3 years agocommands.h: keep entries alphabetically sorted
Zdenek Kabelac [Thu, 25 Feb 2021 21:24:32 +0000 (22:24 +0100)]
commands.h: keep entries alphabetically sorted

For binary search usage commands need to be sorted.
Later patch also adds check if the order would be broken.

3 years agomakefiles: retry faster deps again
Zdenek Kabelac [Tue, 2 Mar 2021 20:20:42 +0000 (21:20 +0100)]
makefiles: retry faster deps again

From commit 29abba378520a270c3a9385724c8ef5df66497b1 we have hopefully
fixed most of troubles for deps tracking we had in past - so retry
again.

Drop explicit configure.h from DEPS - as it's automatically gathered
by gcc dependency tracking anyway.

3 years agomakefiles: better logging
Zdenek Kabelac [Sun, 28 Feb 2021 20:20:54 +0000 (21:20 +0100)]
makefiles: better logging

Show only filename instead of full path name when building
in builddir != srcdir

3 years agomakefiles: integrate DESTDIR
Zdenek Kabelac [Tue, 2 Mar 2021 15:29:07 +0000 (16:29 +0100)]
makefiles: integrate  DESTDIR

Always use lvmdbusdir with DESTDIR.

3 years agomakefiles: fix pofile generation
Zdenek Kabelac [Tue, 2 Mar 2021 00:10:25 +0000 (01:10 +0100)]
makefiles: fix pofile generation

If there is any user of --enable-nls  and wants to get
usable .po language file  -  use 'make pofile'

3 years agomakefiles: cmirrord install through install_cluster
Zdenek Kabelac [Mon, 1 Mar 2021 23:23:45 +0000 (00:23 +0100)]
makefiles: cmirrord install through install_cluster

There is not much left for this target...

3 years agomakefiles: sed
Zdenek Kabelac [Tue, 2 Mar 2021 20:21:38 +0000 (21:21 +0100)]
makefiles: sed

3 years agomakefiles: simplify and cleanup
Zdenek Kabelac [Sun, 28 Feb 2021 00:21:12 +0000 (01:21 +0100)]
makefiles: simplify and cleanup

Print all installed man pages with INSTALL
Simplify distclean handling.

3 years agomakefiles: drop invalid dependency on all
Zdenek Kabelac [Sun, 28 Feb 2021 00:20:28 +0000 (01:20 +0100)]
makefiles: drop invalid dependency on all

3 years agomakefiles: add alias for device-mapper
Zdenek Kabelac [Sun, 28 Feb 2021 00:19:23 +0000 (01:19 +0100)]
makefiles: add alias for device-mapper

Support also 'make device_mapper' so user is less confused.

3 years agomakefiles: fix man-generate rule
Zdenek Kabelac [Sun, 28 Feb 2021 00:17:31 +0000 (01:17 +0100)]
makefiles: fix man-generate rule

Symlink and compiled man-generate binary has to go to builddir.

3 years agomakefiles: avoid sorting by locales
Zdenek Kabelac [Thu, 25 Feb 2021 20:18:05 +0000 (21:18 +0100)]
makefiles: avoid sorting by locales

Localized sort for building source file is not wanted.

3 years agomakefiles: support help target
Zdenek Kabelac [Thu, 25 Feb 2021 16:40:53 +0000 (17:40 +0100)]
makefiles: support help target

Usable targets for top-level make.

3 years agotests: make test complaint to local dev dir
Zdenek Kabelac [Wed, 24 Feb 2021 10:54:24 +0000 (11:54 +0100)]
tests: make test complaint to local dev dir

For test running in 'local' dev dir we want to see loop devices there.
Also add missing notification to lvmetad after wipefs.

3 years agotests: update setting LVM_BINARY for testing
Zdenek Kabelac [Tue, 23 Feb 2021 15:27:44 +0000 (16:27 +0100)]
tests: update setting LVM_BINARY for testing

When testing is running on uninstealled system - prefer our own binary
in tests.

3 years agoconfig: remove redundant comment for deprecated settings
David Teigland [Tue, 2 Mar 2021 20:11:38 +0000 (14:11 -0600)]
config: remove redundant comment for deprecated settings

Drop the comment "This setting is no longer used." which
was printed just before the standard deprecation comment:
"This configuration option is deprecated."

3 years agolvmconfig: fix deprecation message
David Teigland [Tue, 2 Mar 2021 19:49:41 +0000 (13:49 -0600)]
lvmconfig: fix deprecation message

When lvmconfig --typeconfig full printed a deprecated
entry it would attempt to print a non-existing
deprecation comment resulting in output like:
  # (null)        # This setting is no longer used.

3 years agoRevert "tests: enable tests for lvmlockd"
David Teigland [Wed, 24 Feb 2021 16:30:51 +0000 (10:30 -0600)]
Revert "tests: enable tests for lvmlockd"

This reverts commit 99b6173f10fe7e2dbd54bb8734667ca8df69905e.

These tests are disabled with lvmlockd because they use
snapshots without an origin which is not permitted in a
shared vg.

3 years agotests: real_devs remove mistakenly added test
David Teigland [Wed, 24 Feb 2021 16:19:00 +0000 (10:19 -0600)]
tests: real_devs remove mistakenly added test

devicesfile-realdevs is the correct one

3 years agoWHATS_NEW: devices file
David Teigland [Tue, 23 Feb 2021 21:29:23 +0000 (15:29 -0600)]
WHATS_NEW: devices file

3 years agotests: for devices file
David Teigland [Mon, 23 Nov 2020 23:15:25 +0000 (17:15 -0600)]
tests: for devices file

3 years agotests: allow tests to use real devices
David Teigland [Mon, 16 Nov 2020 22:05:39 +0000 (16:05 -0600)]
tests: allow tests to use real devices

user creates a file listing real devices they want
lvm tests to use, and sets LVM_TEST_DEVICE_LIST.
lvm tests can use these with prepare_real_devs
and get_real_devs.
Other aux functions do not work with these devs.

3 years agodevice usage based on devices file
David Teigland [Tue, 23 Jun 2020 18:25:41 +0000 (13:25 -0500)]
device usage based on devices file

The LVM devices file lists devices that lvm can use.  The default
file is /etc/lvm/devices/system.devices, and the lvmdevices(8)
command is used to add or remove device entries.  If the file
does not exist, or if lvm.conf includes use_devicesfile=0, then
lvm will not use a devices file.  When the devices file is in use,
the regex filter is not used, and the filter settings in lvm.conf
or on the command line are ignored.

LVM records devices in the devices file using hardware-specific
IDs, such as the WWID, and attempts to use subsystem-specific
IDs for virtual device types.  These device IDs are also written
in the VG metadata.  When no hardware or virtual ID is available,
lvm falls back using the unstable device name as the device ID.
When devnames are used, lvm performs extra scanning to find
devices if their devname changes, e.g. after reboot.

When proper device IDs are used, an lvm command will not look
at devices outside the devices file, but when devnames are used
as a fallback, lvm will scan devices outside the devices file
to locate PVs on renamed devices.  A config setting
search_for_devnames can be used to control the scanning for
renamed devname entries.

Related to the devices file, the new command option
--devices <devnames> allows a list of devices to be specified for
the command to use, overriding the devices file.  The listed
devices act as a sort of devices file in terms of limiting which
devices lvm will see and use.  Devices that are not listed will
appear to be missing to the lvm command.

Multiple devices files can be kept in /etc/lvm/devices, which
allows lvm to be used with different sets of devices, e.g.
system devices do not need to be exposed to a specific application,
and the application can use lvm on its own set of devices that are
not exposed to the system.  The option --devicesfile <filename> is
used to select the devices file to use with the command.  Without
the option set, the default system devices file is used.

Setting --devicesfile "" causes lvm to not use a devices file.

An existing, empty devices file means lvm will see no devices.

The new command vgimportdevices adds PVs from a VG to the devices
file and updates the VG metadata to include the device IDs.
vgimportdevices -a will import all VGs into the system devices file.

LVM commands run by dmeventd not use a devices file by default,
and will look at all devices on the system.  A devices file can
be created for dmeventd (/etc/lvm/devices/dmeventd.devices)  If
this file exists, lvm commands run by dmeventd will use it.

Internal implementaion:

- device_ids_read - read the devices file
  . add struct dev_use (du) to cmd->use_devices for each devices file entry
- dev_cache_scan - get /dev entries
  . add struct device (dev) to dev_cache for each device on the system
- device_ids_match - match devices file entries to /dev entries
  . match each du on cmd->use_devices to a dev in dev_cache, using device ID
  . on match, set du->dev, dev->id, dev->flags MATCHED_USE_ID
- label_scan - read lvm headers and metadata from devices
  . filters are applied, those that do not need data from the device
  . filter-deviceid skips devs without MATCHED_USE_ID, i.e.
    skips /dev entries that are not listed in the devices file
  . read lvm label from dev
  . filters are applied, those that use data from the device
  . read lvm metadata from dev
  . add info/vginfo structs for PVs/VGs (info is "lvmcache")
- device_ids_find_renamed_devs - handle devices with unstable devname ID
  where devname changed
  . this step only needed when devs do not have proper device IDs,
    and their dev names change, e.g. after reboot sdb becomes sdc.
  . detect incorrect match because PVID in the devices file entry
    does not match the PVID found when the device was read above
  . undo incorrect match between du and dev above
  . search system devices for new location of PVID
  . update devices file with new devnames for PVIDs on renamed devices
  . label_scan the renamed devs
- continue with command processing

3 years agoWHATS_NEW: updates
Zdenek Kabelac [Tue, 23 Feb 2021 14:00:17 +0000 (15:00 +0100)]
WHATS_NEW: updates

3 years agocleanup: comment typo
Zdenek Kabelac [Sat, 20 Feb 2021 22:50:25 +0000 (23:50 +0100)]
cleanup: comment typo

3 years agocleanup: improving message
Zdenek Kabelac [Sat, 20 Feb 2021 22:23:00 +0000 (23:23 +0100)]
cleanup: improving message

lvconvert -Z can be used with snaps & pools.

3 years agocleanup: simplify initilization
Zdenek Kabelac [Sat, 20 Feb 2021 21:44:06 +0000 (22:44 +0100)]
cleanup: simplify initilization

Simplier code and also drop duplicate check for active LV.

3 years agocleanup: simply code
Zdenek Kabelac [Sat, 20 Feb 2021 21:11:30 +0000 (22:11 +0100)]
cleanup: simply code

3 years agolvconvert: change errors to internal ones
Zdenek Kabelac [Sat, 20 Feb 2021 22:01:25 +0000 (23:01 +0100)]
lvconvert: change errors to internal ones

Since these errors should never happen, change them to  internal errors.

3 years agocache: fix warning test
Zdenek Kabelac [Sat, 20 Feb 2021 21:45:13 +0000 (22:45 +0100)]
cache: fix warning test

The cache here is not 'writethough' - so print proper state
(writeback or passthrough)

3 years agolvextend: enable resize of writecached LV
Zdenek Kabelac [Sat, 20 Feb 2021 21:22:51 +0000 (22:22 +0100)]
lvextend: enable resize of writecached LV

3 years agotests: remove local setting of LVM_BINARY
Zdenek Kabelac [Tue, 23 Feb 2021 13:42:47 +0000 (14:42 +0100)]
tests: remove local setting of LVM_BINARY

To better test actually fsadm in test suite - avoid setting
LVM_BINARY locally - since test setup already modifies
PATH to find test's lvm binary as the 1st. in path.

3 years agofsadm: avoid access to unbound variable
Zdenek Kabelac [Tue, 23 Feb 2021 13:14:16 +0000 (14:14 +0100)]
fsadm: avoid access to unbound variable

3 years agocommand defs: add missing commas
David Teigland [Mon, 22 Feb 2021 16:44:01 +0000 (10:44 -0600)]
command defs: add missing commas

even though the parser seems to work fine without them

3 years agofix check for md raid imsm signature on 4k devices
David Teigland [Thu, 18 Feb 2021 17:42:32 +0000 (11:42 -0600)]
fix check for md raid imsm signature on 4k devices

On devices with 4k logical block size, the imsm signature
is located 8k from the end of the device, not 1k as is
the case for devices with 512 LBS.

3 years agotests: Skip test killing kernel
Marian Csontos [Wed, 17 Feb 2021 12:26:06 +0000 (13:26 +0100)]
tests: Skip test killing kernel

Bug 1916891

3 years agoWHATS_NEW: updates
Zdenek Kabelac [Wed, 17 Feb 2021 10:27:57 +0000 (11:27 +0100)]
WHATS_NEW: updates

3 years agomake: generate
Zdenek Kabelac [Tue, 16 Feb 2021 20:30:06 +0000 (21:30 +0100)]
make: generate

3 years agotests: readonly snapshot thick origin can't be merged
Zdenek Kabelac [Wed, 17 Feb 2021 10:38:28 +0000 (11:38 +0100)]
tests: readonly snapshot thick origin can't be merged

When user sets snapshot thick origin as read-only - lvconvert --merge refuses
to merge until user swiches origin to 'read-write'.

3 years agolvmlocdk: correct creation of dm path vg sanlock LV
Zdenek Kabelac [Sun, 14 Feb 2021 16:47:08 +0000 (17:47 +0100)]
lvmlocdk: correct creation of dm path vg sanlock LV

Vgname may contain '-' and needs escaping '--' for /dev/mapper path.

3 years agotests: lvconvert vdo profile support
Zdenek Kabelac [Tue, 16 Feb 2021 20:30:40 +0000 (21:30 +0100)]
tests: lvconvert vdo profile support

3 years agoman: vdo drop resize restriction comment
Zdenek Kabelac [Mon, 15 Feb 2021 11:18:54 +0000 (12:18 +0100)]
man: vdo drop resize restriction comment

lvm2 supports resize of cached vdo pool volumes.

3 years agotests: check resize of cached vdopool
Zdenek Kabelac [Wed, 17 Feb 2021 10:50:27 +0000 (11:50 +0100)]
tests: check resize of cached vdopool

3 years agovdo: just one probe is enough
Zdenek Kabelac [Wed, 17 Feb 2021 10:12:11 +0000 (11:12 +0100)]
vdo: just one probe is enough

target_present_version() can handle modprobing no need to try it
twice.

3 years agolvconvert: VDO kernel support before converting
Zdenek Kabelac [Wed, 17 Feb 2021 10:13:19 +0000 (11:13 +0100)]
lvconvert: VDO kernel support before converting

Early check for kernel support of VDO target before starting any
conversion work.

3 years agolvconvert: vdo may convert already formated vdo
Zdenek Kabelac [Tue, 16 Feb 2021 20:26:35 +0000 (21:26 +0100)]
lvconvert: vdo may convert already formated vdo

User use 'lvconvert -Zn --type vdo-pool' to convert an existing
vdo formated volume and skip lvm2 internal formating.
This however requires user is passing proper matching parameters.
For them user can use --profile|--metadataprofile option whos
support has been also enhanced.

TODO: add support to read values directly from formated volume.

3 years agolvchange: remove unneeded call
Zdenek Kabelac [Sun, 14 Feb 2021 16:27:45 +0000 (17:27 +0100)]
lvchange: remove unneeded call

Sync is already happining in activate_and_wipe_lvlist().

3 years agolv_manip: avoid removing LV when converting
Zdenek Kabelac [Wed, 17 Feb 2021 10:09:41 +0000 (11:09 +0100)]
lv_manip: avoid removing LV when converting

In some cases we use 'creation' also during conversion.
Here it can be actually unwanted side effect we may remove
not just newly created layers - but also original converted LV.

So until we make clear how to properly revert from some errors
in middle of conversion, disable removal for any 'lvconvert' commands.

3 years agotests: lvdisplay does not crash for merged thin
Zdenek Kabelac [Sat, 13 Feb 2021 22:10:15 +0000 (23:10 +0100)]
tests: lvdisplay does not crash for merged thin

3 years agolvdisplay: fix show of merged thin snapshot
Zdenek Kabelac [Fri, 12 Feb 2021 14:11:48 +0000 (15:11 +0100)]
lvdisplay: fix show of merged thin snapshot

When lvdisplay was executed and thin snaphost has be merged to
thin origin and the operation has been postponed till devices
are closed, command crashed.

Check LV is COW before trying to check snapshot percentage.

3 years agotests: lvconvert thin profile conversion
Zdenek Kabelac [Tue, 16 Feb 2021 23:07:50 +0000 (00:07 +0100)]
tests: lvconvert thin profile conversion

3 years agolvconvert: thin errorwhenfull and recalculation
Zdenek Kabelac [Tue, 16 Feb 2021 23:10:32 +0000 (00:10 +0100)]
lvconvert: thin errorwhenfull and recalculation

When converting an existing LV to thin-pool,
user may now pass also '--errorwhenfull' option
like with 'lvcreate'.

Also recalculate chunksize when performace profile is
used with conversion (again matching lvcreate).

Adds missing flagging for uncropped metadata sizes.

3 years agoinclude lvm version in debug output
David Teigland [Fri, 12 Feb 2021 16:51:41 +0000 (10:51 -0600)]
include lvm version in debug output

3 years agoscan: wipe filters when dropping scanned data
David Teigland [Wed, 10 Feb 2021 20:06:58 +0000 (14:06 -0600)]
scan: wipe filters when dropping scanned data

Fix clearing persistent filter state when clearing all
the state from a label_scan.

label_scan reads devs and saves info in bcache, lvmcache,
and in the persistent filter.  In some uncommon cases, an
lvm command wants to clear all info from a prior label_scan,
and repeat label_scan from scratch.  In these cases, info
in lvmcache, bcache and the persistent filter all need to
be cleared before repeating label_scan.

By missing the persistent filter wiping, outdated persistent
filter info, from a prior label_scan, could cause lvm to
incorrectly filter devices that change between polling intervals.
(i.e. if the device changes in such a way that the filtering
results change.)

A case where lvm wants to do multiple label_scans is a
polling command (like lvconvert --merge), when lvmpolld
has been disabled, so that the command itself needs to
to do repeated polling checks.

3 years agoWHATS_NEW: update
Zdenek Kabelac [Wed, 10 Feb 2021 14:34:12 +0000 (15:34 +0100)]
WHATS_NEW: update

3 years agogcc: drop unused assingment
Zdenek Kabelac [Wed, 10 Feb 2021 13:55:35 +0000 (14:55 +0100)]
gcc: drop unused assingment

3 years agogcc: ensure pointer is always defined
Zdenek Kabelac [Wed, 10 Feb 2021 13:30:58 +0000 (14:30 +0100)]
gcc: ensure pointer is always defined

3 years agolibdm: simplify line emitter checking
Zdenek Kabelac [Wed, 10 Feb 2021 14:10:28 +0000 (15:10 +0100)]
libdm: simplify line emitter checking

3 years agodevice_mapper: simplify line emitter checking
Zdenek Kabelac [Wed, 10 Feb 2021 14:22:39 +0000 (15:22 +0100)]
device_mapper: simplify line emitter checking

3 years agolabel: avoid rescaning unusable DM devices
Zdenek Kabelac [Tue, 9 Feb 2021 23:43:40 +0000 (00:43 +0100)]
label: avoid rescaning unusable DM devices

3 years agolvconvert: read-only origin cannot be merged
Zdenek Kabelac [Tue, 9 Feb 2021 23:40:21 +0000 (00:40 +0100)]
lvconvert: read-only origin cannot be merged

When user sets snapshost origin as read-only,
lvm will not allow simple merge and user needs to
flip permission,

3 years agolvchange: snapshot thick origin permission rw/r
Zdenek Kabelac [Tue, 9 Feb 2021 23:38:37 +0000 (00:38 +0100)]
lvchange: snapshot thick origin permission rw/r

User is allowed to change permission for thick origin.
FIXME: it's not quite clear why few others are prohibited to change.

3 years agosnapshot: create origin of virtual snap read only
Zdenek Kabelac [Tue, 9 Feb 2021 21:31:31 +0000 (22:31 +0100)]
snapshot: create origin of virtual snap read only

When creating old fashioned way thick virtual snapshot,
use read-only 'zero' _vorigin device.

3 years agodev-cache: remove duplicated allocation
Zdenek Kabelac [Wed, 10 Feb 2021 13:33:17 +0000 (14:33 +0100)]
dev-cache: remove duplicated allocation

Merge mistake missed to remove allocation that is now postponed
until it's really needed.

3 years agodev_get_primary_dev: fix invalid path check
David Teigland [Tue, 9 Feb 2021 15:47:08 +0000 (09:47 -0600)]
dev_get_primary_dev: fix invalid path check

Fix commit bee9f4efdd81 "filter-mpath: work with nvme devices"
which removed setting the path for readlink.

3 years agodev-type: sysfs attrs without sectors
Zdenek Kabelac [Mon, 8 Feb 2021 23:43:13 +0000 (00:43 +0100)]
dev-type: sysfs attrs without sectors

Split function for reading attrs in sectors.

3 years agotypo: fixes
Zdenek Kabelac [Mon, 8 Feb 2021 22:51:56 +0000 (23:51 +0100)]
typo: fixes

forgotten merge from last batch.

3 years agoWHATS_NEW: updates
Zdenek Kabelac [Mon, 8 Feb 2021 22:16:54 +0000 (23:16 +0100)]
WHATS_NEW: updates

3 years agodev-type: convert to use log_warn
Zdenek Kabelac [Sun, 7 Feb 2021 13:06:12 +0000 (14:06 +0100)]
dev-type: convert to use log_warn

Keep log_error designated only for 'erroring' condition of command
and replace these errors with log_warn() WARNING.

Also do some indent changes.

3 years agodev-type: use fopen for sysfs file
Zdenek Kabelac [Sun, 7 Feb 2021 13:07:17 +0000 (14:07 +0100)]
dev-type: use fopen for sysfs file

Directly open sysfs files and save extra stat() call which
is not adding any extra safety in sysfs dir.

3 years agodev-type: dev_is_pmem reuses topology read code
Zdenek Kabelac [Sun, 7 Feb 2021 14:03:13 +0000 (15:03 +0100)]
dev-type: dev_is_pmem reuses topology read code

3 years agodev-cache: better code reuse for _add_alias
Zdenek Kabelac [Sun, 7 Feb 2021 18:30:26 +0000 (19:30 +0100)]
dev-cache: better code reuse for _add_alias

Move path copying into _add_alish together with hashing.
Remove duplicated code.

3 years agodev-cache: check for nvme name while adding alias
Zdenek Kabelac [Sun, 7 Feb 2021 13:04:58 +0000 (14:04 +0100)]
dev-cache: check for nvme name while adding alias

Instead of repeated list retest, compare name once during add of alias.

3 years agotargets: use target_present_version
Zdenek Kabelac [Sun, 7 Feb 2021 20:48:18 +0000 (21:48 +0100)]
targets: use target_present_version

Skip duplicated  dm version   ioctl() on every startup.

3 years agotests: check event_activation can be disabled
Zdenek Kabelac [Mon, 8 Feb 2021 21:27:59 +0000 (22:27 +0100)]
tests: check event_activation can be disabled

3 years agotests: support for resized cached LVs
Zdenek Kabelac [Sun, 7 Feb 2021 17:45:43 +0000 (18:45 +0100)]
tests: support for resized cached LVs

Support for cached LVs is now enabled.

3 years agolv_resize: support resizing of cached volumes
Zdenek Kabelac [Sun, 7 Feb 2021 19:12:00 +0000 (20:12 +0100)]
lv_resize: support resizing of cached volumes

Automatically figure out resizable layer in the LV stack and
resize it online.

Split check for reshaped raids and postpone removal of
unused space after finished reshaping after metadata archiving.

Drop warning about unsupported automatic resize of monitored thin-pool.

Currently there is not yet support for resize of writecache.

3 years agolv_manip: reuse function also during reduction
Zdenek Kabelac [Fri, 5 Feb 2021 10:37:52 +0000 (11:37 +0100)]
lv_manip: reuse function also during reduction

Move function _setup_lv_size() in front of _lv_reduce() so
it can be reused also in this function.
Avoid propagating 0 length to upper layer.

3 years agolv_resize: use 'bad' code path for error case
Zdenek Kabelac [Sat, 6 Feb 2021 23:39:13 +0000 (00:39 +0100)]
lv_resize: use 'bad' code path for error case

3 years agothin: check for overprovisioning only once
Zdenek Kabelac [Sat, 6 Feb 2021 23:37:37 +0000 (00:37 +0100)]
thin: check for overprovisioning only once

3 years agothinpool: use lv_config_profil for crop_metadata
Zdenek Kabelac [Thu, 4 Feb 2021 22:26:08 +0000 (23:26 +0100)]
thinpool: use lv_config_profil for crop_metadata

Better support for thin-pools with individual profiles introduced
in the recent patch b4212be2e7e8797bbf8f9a166347659cc39ba075.

3 years agopvscan: support disabled event_activation
Zdenek Kabelac [Mon, 8 Feb 2021 15:28:18 +0000 (16:28 +0100)]
pvscan: support disabled event_activation

In past we had this control with use_lvmetad check for
pvscan --cache -aay

Howerer this got lost with lvmetad removal commit:
117160b27e510dceb1ed6acf995115c040acd88d

When user sets lvm.conf global/event_activation=0
pvscan service will no longer auto activate any LVs on appeared PVs.

3 years agofix for md component detection changes
David Teigland [Mon, 8 Feb 2021 17:23:42 +0000 (11:23 -0600)]
fix for md component detection changes

And some fine tuning of when the checks are applied
in "start" mode.

3 years agolvmcache: remove unused variable from last commit
David Teigland [Mon, 8 Feb 2021 16:22:30 +0000 (10:22 -0600)]
lvmcache: remove unused variable from last commit

3 years agomd component detection changes
David Teigland [Fri, 5 Feb 2021 22:16:03 +0000 (16:16 -0600)]
md component detection changes

Move extra md component detection into the label scan phase.
It had been in set_pv_devices which was deep within the vg_read
phase, which wasn't a good place (better to detect that earlier.)
Now that pv metadata info is available in the scan phase, the pv
details (size and device_hint) can be used for extra md checking.

Use the device_hint from the pv metadata to trigger a full md
component check if the device_hint begins with /dev/md.

Stop triggering full md component checks based on missing
udev info for a dev.

Changes to tests to reflect that the code is now detecting
md components in some test case that it wasn't before.

3 years agodm: add debugging to include table differences
David Teigland [Wed, 3 Feb 2021 19:44:10 +0000 (13:44 -0600)]
dm: add debugging to include table differences

When dm tables are reloaded, include log_debug info
that will show the details of why the reload is needed.

3 years agohints: clean up comment and init settings
David Teigland [Tue, 2 Feb 2021 21:14:05 +0000 (15:14 -0600)]
hints: clean up comment and init settings

no behavior change

3 years agocachevol: allow forced detaching of damaged or invalid cachevol
David Teigland [Tue, 12 Jan 2021 17:53:02 +0000 (11:53 -0600)]
cachevol: allow forced detaching of damaged or invalid cachevol

A cachevol can be forcibly detached when it's missing devices.
Also allow this if it's damaged/invalid and unrepairable.
This would be needed to recover data from the origin LV after
a cachevol is lost or damaged beyond repair.

3 years agotest: check read_only_volume_list tagging works
Zdenek Kabelac [Tue, 2 Feb 2021 18:53:28 +0000 (19:53 +0100)]
test: check read_only_volume_list tagging works

3 years agolvcreate: use lv_passes_readonly_filter
Zdenek Kabelac [Tue, 2 Feb 2021 18:53:59 +0000 (19:53 +0100)]
lvcreate: use lv_passes_readonly_filter

Check if created LV is going to be activated read-only
because such LV cannot be zeroed (equals to use
option '-pr').

3 years agowritecache: let block_size setting override device block sizes
David Teigland [Tue, 12 Jan 2021 20:41:38 +0000 (14:41 -0600)]
writecache: let block_size setting override device block sizes

In cases where lvconvert does not detect a fs block size on the
device, it falls back to choosing a writecache block size based
on the device's LBS and PBS (tries to match those.)

If the user specifies a writecache block size on the command
line (--cachesettings block_size=4096|512), lvconvert currently
fails and reports an error if the user-specified value does not
match the value lvconvert would have chosen based on LBS and PBS.

The purpose of allowing a user-specified value on the command line
is to override what lvconvert would otherwise do, so change this
to just print a warning that the user value does not match the
value that would be chosen based on the LBS/PBS, and then take
the user-specified value as the writecache block size.

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