]> sourceware.org Git - lvm2.git/log
lvm2.git
3 years agolvm.conf: remove reference to locking_type
David Teigland [Tue, 17 Nov 2020 17:19:55 +0000 (11:19 -0600)]
lvm.conf: remove reference to locking_type

3 years agoman: vgsplit source and destination VGs
David Teigland [Tue, 17 Nov 2020 17:00:40 +0000 (11:00 -0600)]
man: vgsplit source and destination VGs

make clearer which is source and which is destination

3 years agolvchange: fix error for foreign vg activation
David Teigland [Tue, 17 Nov 2020 15:22:40 +0000 (09:22 -0600)]
lvchange: fix error for foreign vg activation

was using ECMD_FAILED instead of 0.

3 years agotests: integrity mismatch checks for all raid levels
David Teigland [Wed, 11 Nov 2020 21:13:46 +0000 (15:13 -0600)]
tests: integrity mismatch checks for all raid levels

Verify that corruption is corrected for raid levels other
than raid1.  For other raid levels, attempt to corrupt the
given file pattern on each underlying device, since we don't
know which device contains the file being corrupted.
This ensures that corruption is actually be introduced
when testing the other raid levels.

Verify that corruption is being corrected by checking
the integritymismatches count is non-zero for the raid LV,
which includes the total from all images (since we don't
know which image will have the corruption.)

3 years agointegrity: display total mismatches at raid LV level
David Teigland [Wed, 11 Nov 2020 21:10:15 +0000 (15:10 -0600)]
integrity: display total mismatches at raid LV level

Each integrity image in a raid LV reports its own number
of integrity mismatches, e.g.

lvs -o integritymismatches vg/lv_rimage_0
lvs -o integritymismatches vg/lv_rimage_1

In addition to this, allow the total number of integrity
mismatches from all images to be displayed for the raid LV.

lvs -o integritymismatches vg/lv

shows the number of mismatches from both lv_rimage_0 and
lv_rimage_1.

3 years agotests: update integrity tests
David Teigland [Tue, 10 Nov 2020 23:41:04 +0000 (17:41 -0600)]
tests: update integrity tests

simplified the method of corrupting data, the old method
was not working reliably.  moved syncation tests to a
different file

3 years agowritecache: supported in dm-writecache version 3
David Teigland [Mon, 9 Nov 2020 15:47:01 +0000 (09:47 -0600)]
writecache: supported in dm-writecache version 3

not version 2

3 years agoman: update vdo
Zdenek Kabelac [Tue, 3 Nov 2020 15:32:14 +0000 (16:32 +0100)]
man: update vdo

Enhance VDO man page with description of memory usage
and space requirements chapter.

Remove some unneeded blank lines in man page.

Use more precise terminology.

Correct examples since  cpool and vpool are protected names.

3 years agopvck: fix previous commit
David Teigland [Wed, 28 Oct 2020 21:50:47 +0000 (16:50 -0500)]
pvck: fix previous commit

line to setup bcache was misplaced in
commit 5a94126e7a28

3 years agoRevert "tests: revert lvm shell use in pvck-dump"
David Teigland [Wed, 28 Oct 2020 21:45:04 +0000 (16:45 -0500)]
Revert "tests: revert lvm shell use in pvck-dump"

This reverts commit 05d23b2dd80919ebd2239cfd7f8e08d5de9ebace.

this required enabling editline in configure

3 years agotests: revert lvm shell use in pvck-dump
David Teigland [Tue, 27 Oct 2020 20:44:56 +0000 (15:44 -0500)]
tests: revert lvm shell use in pvck-dump

doesn't work on my machine

3 years agopvck: fix dev filtering
David Teigland [Tue, 27 Oct 2020 20:42:08 +0000 (15:42 -0500)]
pvck: fix dev filtering

filters needing io weren't being run because bcache
wasn't set up.  Read the first 4k of the device
before doing filtering or reading ondisk structs to
reduce reads.

3 years agopvck: handle first mda at non-4096 offset
David Teigland [Tue, 27 Oct 2020 19:28:54 +0000 (14:28 -0500)]
pvck: handle first mda at non-4096 offset

It's possible for a machine with a non-4k page size
to create a PV with an mda_header at an offset other
than 4k.  Fix pvck --dump to work with these other
mda offsets.  pvck --repair will write a new first
mda at 4096 but lvm with other page sizes will work
with this.

3 years agowritecache: disallow partial or degraded activation
David Teigland [Mon, 26 Oct 2020 20:35:23 +0000 (15:35 -0500)]
writecache: disallow partial or degraded activation

when either main or fast lvs are incomplete

3 years agolvchange: allow syncaction check with integrity
David Teigland [Mon, 26 Oct 2020 17:27:18 +0000 (12:27 -0500)]
lvchange: allow syncaction check with integrity

syncaction check will detect and correct integrity checksum mismatches.

3 years agopvcreate: clean up opening and filtering of args
David Teigland [Fri, 23 Oct 2020 18:53:52 +0000 (13:53 -0500)]
pvcreate: clean up opening and filtering of args

The args for pvcreate/pvremove (and vgcreate/vgextend
when applicable) were not efficiently opened, scanned,
and filtered.  This change reorganizes the opening
and filtering in the following steps:

- label scan and filter all devs
  . open ro
  . standard label scan at the start of command

- label scan and filter dev args
  . open ro
  . uses full md component check
  . typically the first scan and filter of pvcreate devs

- close and reopen dev args
  . open rw and excl

- repeat label scan and filter dev args
  . using reopened rw excl fd

- wipe and write new headers
  . using reopened rw excl fd

3 years agogcc: cleanup warns from older gcc
Zdenek Kabelac [Sun, 25 Oct 2020 20:56:02 +0000 (21:56 +0100)]
gcc: cleanup warns from older gcc

3 years agotests: minor update
Zdenek Kabelac [Sun, 25 Oct 2020 19:23:41 +0000 (20:23 +0100)]
tests: minor update

3 years agofsadm: better check for getsize64 support
Zdenek Kabelac [Sun, 25 Oct 2020 19:19:31 +0000 (20:19 +0100)]
fsadm: better check for getsize64 support

Older blockdev tool return failure error code with --help,
and since now the tool abort on command failure, lets
detect missing --getsize64 support directly by running
command and check if it returns something usable.

It's likely very hard to have the system with
such old blockdev tool and newer lvm2 compiled.

3 years agoWHATS_NEW: update
Zdenek Kabelac [Fri, 23 Oct 2020 23:40:55 +0000 (01:40 +0200)]
WHATS_NEW: update

3 years agoman: regenerate
Zdenek Kabelac [Mon, 19 Oct 2020 10:34:36 +0000 (12:34 +0200)]
man: regenerate

3 years agoman: more precise UNIT
Zdenek Kabelac [Mon, 19 Oct 2020 10:32:46 +0000 (12:32 +0200)]
man: more precise UNIT

Since 'kilobytes' could be seen in 2 way - SI as '1000',
while all programmers sees it as '1024' - switch to
commonly acceptted  KiB, MiB....

Resolves RHBZ 1496255.

3 years agolv_manip: add space into message
Zdenek Kabelac [Mon, 19 Oct 2020 08:28:06 +0000 (10:28 +0200)]
lv_manip: add space into message

Just add space between %s(.

3 years agotests: fsadm test continue after fs repair
Zdenek Kabelac [Fri, 23 Oct 2020 22:29:45 +0000 (00:29 +0200)]
tests: fsadm test continue after fs repair

Test case where filesystem has been corrected via fsck.
In such case fsck returns '1' as success and should be
handled in a same way as '0' since fs is correct.

3 years agofsadm: enhance error handling
Zdenek Kabelac [Fri, 23 Oct 2020 23:13:42 +0000 (01:13 +0200)]
fsadm: enhance error handling

Set more secure bash failure mode for pipilines.
Avoid using unset variables.
Enhnace error reporting for failing command.
Avoid using error via 'case..esac || error'.

3 years agofsadm: handle fsck return 1 for corrected fs
Zdenek Kabelac [Fri, 23 Oct 2020 22:42:31 +0000 (00:42 +0200)]
fsadm: handle fsck return 1 for corrected fs

3 years agofsadm: use NULL
Zdenek Kabelac [Fri, 23 Oct 2020 22:40:34 +0000 (00:40 +0200)]
fsadm: use NULL

Use consistently $NULL as in other places.

3 years agoget dev size when setting pv device
David Teigland [Wed, 21 Oct 2020 21:21:50 +0000 (16:21 -0500)]
get dev size when setting pv device

In some cases the dev size may not have been read yet
in set_pv_devices().  In this case get the dev size
before comparing the dev size with the pv size.

3 years agopvscan: rework to improve PVs without metadata
David Teigland [Thu, 15 Oct 2020 19:11:08 +0000 (14:11 -0500)]
pvscan: rework to improve PVs without metadata

Restructure the pvscan code, and add new temporary files
that list pvids in a VG, used for processing PVs that
have no metadata.

The new temp files, in /run/lvm/pvs_lookup/<vgname>, allow a
proper pvscan --cache to be done on PVs that have no metadata.
pvscan --cache <dev> is only supposed to read <dev>, but when
<dev> has no metadata, this had not been possible.  The
command had to fall back to scanning all devices to read all
VG metadata to get the list of all PVIDs needed to check for
a complete VG.  Now, the temp file can be used in place of
reading metadata from all PVs on the system.

3 years agoadd label_scan_devs_cached
David Teigland [Wed, 21 Oct 2020 17:20:17 +0000 (12:20 -0500)]
add label_scan_devs_cached

label_scan_devs without invalidating data first
for cases where the caller wants to use any
bcache data they have already read.

3 years agoadd label_read_pvid
David Teigland [Thu, 15 Oct 2020 19:05:45 +0000 (14:05 -0500)]
add label_read_pvid

To read the lvm headers and set dev->pvid if the
device is a PV.  Difference from label_scan_ functions
is this does not read any vg metadata or add any info
to lvmcache.

3 years agolvmcache: rename label_read label_scan_dev
David Teigland [Thu, 15 Oct 2020 17:56:36 +0000 (12:56 -0500)]
lvmcache: rename label_read label_scan_dev

for consistent naming with other similar functions

3 years agolvmcache: add lvmcache_get_dev_mda
David Teigland [Thu, 15 Oct 2020 17:53:01 +0000 (12:53 -0500)]
lvmcache: add lvmcache_get_dev_mda

for future patch

3 years agoscanning: improve filtering control
David Teigland [Tue, 20 Oct 2020 20:10:08 +0000 (15:10 -0500)]
scanning: improve filtering control

Filtering in label_scan was controlled indirectly by
the fact that bcache was not yet set up when label_scan
first ran.  The result is that filters that needed data
would not run and would return -EAGAIN, which would
result in the dev flag FILTER_AFTER_SCAN being set.
After the dev header was read for checking the label,
filters would be rechecked because of FILTER_AFTER_SCAN.
All filters would be checked this time because bcache
was now set up, and the filters needing data would
largely use data already scanned for reading the label.
This design worked but is hard to adjust for future
cases where bcache is already set up.

Replace this method (based on setting up bcache, or not)
with a new cmd flag filter_nodata_only.  When this flag
is set filters that need data will not run.  This allows
the same label_scan behavior when bcache has been set up.
There are no expected changes in behavior.

3 years agofilters: nodata option
David Teigland [Mon, 19 Oct 2020 21:46:20 +0000 (16:46 -0500)]
filters: nodata option

When filter_nodata_only is set, a filter that uses
data is skipped.

3 years agofilters: allow filter wipe for one device
David Teigland [Tue, 20 Oct 2020 20:17:56 +0000 (15:17 -0500)]
filters: allow filter wipe for one device

as passes_filter already does

3 years agotests: writecache-misc disable with lvmlockd
David Teigland [Wed, 21 Oct 2020 17:47:28 +0000 (12:47 -0500)]
tests: writecache-misc disable with lvmlockd

in a shared vg pvmove requires a named lv

3 years agotests: check dmevent with bigger reserved_stack
Zdenek Kabelac [Tue, 20 Oct 2020 20:28:58 +0000 (22:28 +0200)]
tests: check dmevent with bigger reserved_stack

Check dmeventd remains working when reserved_stack
is above 300KiB.

3 years agomemlock: allocate at most halve of rlimit stack
Zdenek Kabelac [Tue, 20 Oct 2020 20:26:44 +0000 (22:26 +0200)]
memlock: allocate at most halve of rlimit stack

Touch of stack allocation validated given size with rlimit
and if the reserved_stack was above rlimit, its been completely
ignored - now we will always touch stack upto rlimit/2 size.

3 years agolvmcmdlib: lvm2_init_threaded
Zdenek Kabelac [Tue, 20 Oct 2020 20:22:52 +0000 (22:22 +0200)]
lvmcmdlib:  lvm2_init_threaded

cmd context has 'threaded' value that used be set
by clvmd - and allowed proper memory locking management.
Reuse same bit for dmeventd.

Since dmeventd is using 300KiB stack per thread,
we will ignore any user settings for allocation/reserved_stack
until some better solution is find.
This avoids crashing of dmevend when user changes this value
and because in most cases lvm2 should work ok with 64K stack
size, this change should not cause any problems.

3 years agolibdm: relocate code for sending messages
Zdenek Kabelac [Mon, 19 Oct 2020 14:48:04 +0000 (16:48 +0200)]
libdm: relocate code for sending messages

To be able to send messages for recently resumed devices,
move code into inner loop.
Matching commit c1a6b10d09aae6179e4f08c7d8c03d5e3068ad94.

3 years agocov: split check for type assignment
Zdenek Kabelac [Mon, 19 Oct 2020 14:43:50 +0000 (16:43 +0200)]
cov: split check for type assignment

Check that type is always defined, if not make it explicit internal
error (although logged as debug - so catched only with proper lvm.conf
setting).
This ensures later type being NULL can't be dereferenced with coredump.

3 years agodm: remove created devices on error path
Zdenek Kabelac [Fri, 16 Oct 2020 18:58:58 +0000 (20:58 +0200)]
dm: remove created devices on error path

DM tree keeps track of created device while preloading a device tree.
When fail occures during such preload, it will now try to remove
all created and preloaded device. This makes it easier to maintain
stacking of device, since we do not need to check in-depth for
existance of all possible created devices during the failure.

3 years agodebug: shorten error message
Zdenek Kabelac [Mon, 19 Oct 2020 12:28:58 +0000 (14:28 +0200)]
debug: shorten error message

Just check for sigint during log_error().

3 years agolibdm: validate thin-pool before sending messages
Zdenek Kabelac [Mon, 28 Sep 2020 21:12:48 +0000 (23:12 +0200)]
libdm: validate thin-pool before sending messages

Alhtough lvm2 does validation on its side, ensure DM code
is not sending messages to failed thin pool.

3 years agolibdm: enhance error message
Zdenek Kabelac [Fri, 25 Sep 2020 17:10:30 +0000 (19:10 +0200)]
libdm: enhance error message

3 years agolibdm: split code for sending message
Zdenek Kabelac [Sat, 23 Jun 2018 19:00:40 +0000 (21:00 +0200)]
libdm: split code for sending message

Move message sending from _thin_pool_node_message to
new _node_message for possible better code sharing.

3 years agoproperties: fix data_usage typo
Zdenek Kabelac [Fri, 16 Oct 2020 15:51:23 +0000 (17:51 +0200)]
properties: fix data_usage typo

Patch 4de6f58085c533c79ce2e0db6cdeb6ed06fe05f8 introduce typo,
we need to use data_usage.

Note: this code was used by lvmapp library and currently is unused.

3 years agotests: extend area covered by error target
Zdenek Kabelac [Tue, 6 Oct 2020 13:45:19 +0000 (15:45 +0200)]
tests: extend area covered by error target

Since 'BLKZEROOUT' streams out more block at once, at can easily
zero-out larger set of blocks after 1st. failing one.

So the test is adapted to fully 'hide' swap header under error target.

3 years agomake: generate
Marian Csontos [Thu, 15 Oct 2020 09:16:54 +0000 (11:16 +0200)]
make: generate

3 years agogitignore: ignore gcov files
Marian Csontos [Thu, 15 Oct 2020 09:13:13 +0000 (11:13 +0200)]
gitignore: ignore gcov files

3 years agoRevert "tests: Adapt RAID test to changes"
Marian Csontos [Tue, 13 Oct 2020 11:15:16 +0000 (13:15 +0200)]
Revert "tests: Adapt RAID test to changes"

The cpnversion of degraded RAID should still report a failure.

This reverts commit e12bdd591a1e60f055baee6cf5e9a144ea245a33.

3 years agorpm: bare words are no longer supported
Zdenek Kabelac [Fri, 2 Oct 2020 20:13:51 +0000 (22:13 +0200)]
rpm: bare words are no longer supported

Update for new rpm requirement and use "..." words.

3 years agotests: enable tests for lvmlockd
Zdenek Kabelac [Fri, 2 Oct 2020 19:35:44 +0000 (21:35 +0200)]
tests: enable tests for lvmlockd

3 years agotests: aux hides zero and error device
Zdenek Kabelac [Fri, 2 Oct 2020 17:19:30 +0000 (19:19 +0200)]
tests: aux hides zero and error device

When ERR_DEV and ZERO_DEV are used, they are automatically
taken down when the last user no longer needs them,
so hide them from 'forgotten' device check.

3 years agotests: rename shown debug trace
Zdenek Kabelac [Fri, 2 Oct 2020 17:17:36 +0000 (19:17 +0200)]
tests: rename shown debug trace

As there could be few invokes of stacktrace, avoid
repeatedly display logs from commands.
So after first display rename  debug.log* -> debug_log
so the file still can remain for reading in test dir.

3 years agodebug: drop vgid from debug
Zdenek Kabelac [Fri, 2 Oct 2020 20:22:25 +0000 (22:22 +0200)]
debug: drop vgid from debug

From the code can be seen the VGID will be always NULL here
as vgid != NULL is already handled before.
Thus drop from being displayed.

3 years agodebug: no backtrace
Zdenek Kabelac [Fri, 2 Oct 2020 09:14:18 +0000 (11:14 +0200)]
debug: no backtrace

As the path already printed verbose message drop backtrace.

3 years agodebug: show actually reason for taking this code path
Zdenek Kabelac [Fri, 2 Oct 2020 09:12:49 +0000 (11:12 +0200)]
debug: show actually reason for taking this code path

Instead of not so useful backtrace, report what was the reason.

3 years agodebug: drop FD from error message
Zdenek Kabelac [Fri, 2 Oct 2020 09:10:44 +0000 (11:10 +0200)]
debug: drop FD from error message

Since now the error path already has device close and set -1,
there is not much in printing this info - actually shouldn't be
there at all..

3 years agodebug: update messages
Zdenek Kabelac [Tue, 29 Sep 2020 21:48:45 +0000 (23:48 +0200)]
debug: update messages

3 years agowipe_lv: use BLKZEROOUT when possible
Zdenek Kabelac [Fri, 2 Oct 2020 17:32:28 +0000 (19:32 +0200)]
wipe_lv: use BLKZEROOUT when possible

Since BLKZEROOUT ioctl should be supposedly fastest
way how to clear block device start using this ioctl
for zeroing a device. Commonly we do zero typically
small portion of a device (8KiB) - however since we now
also started to zero metadata devices, in the case
of i.e. thin-pool metadata this can go upto ~16GiB
and here the performance starts to be noticable.

3 years agowipe_lv: interruptible wiping
Zdenek Kabelac [Fri, 2 Oct 2020 17:31:05 +0000 (19:31 +0200)]
wipe_lv: interruptible wiping

Since we now block signals and wiping may take unexpectedly long
time - support breaking command while wipe is in progress.

3 years agowipe_lv: drop label_scan_invalidate on error path
Zdenek Kabelac [Fri, 2 Oct 2020 17:26:58 +0000 (19:26 +0200)]
wipe_lv: drop label_scan_invalidate on error path

Since dev_set_bytes() now closes  dev on error path itself,
remove this unneeded call now (introduced few commits back
in history thus removing comment from WHATS_NEW)

3 years agobcache: use flexible arrays
Zdenek Kabelac [Wed, 30 Sep 2020 21:28:44 +0000 (23:28 +0200)]
bcache: use flexible arrays

Cleanup, allocate whole struct with a single malloc call.

3 years agobcache: support interrupts when waiting on IO
Zdenek Kabelac [Fri, 2 Oct 2020 15:16:14 +0000 (17:16 +0200)]
bcache: support interrupts when waiting on IO

Since lvm2 normally block signals during protected
phase where it does not want to be interrupted.
Support interruptible processing when allowed
in section between sigint_allow() ... sigint_restore())
and let the 'io_getenvents()'  finish with EINTR.

3 years agobcache: fix busy loop with too many errors
Zdenek Kabelac [Fri, 2 Oct 2020 15:42:50 +0000 (17:42 +0200)]
bcache: fix busy loop with too many errors

When bcache tries to write data to a faulty device,
it may get out of caching blocks and then just busy-loops
on a CPU - so this check protects this by checking
if there is already max_io (~64) errored blocks.

3 years agobcache: fix waiting problem for completed IO
Zdenek Kabelac [Fri, 2 Oct 2020 15:18:12 +0000 (17:18 +0200)]
bcache: fix waiting problem for completed IO

Call _wait_all() which does check whether there is still
some pending IO before sleep. Otherwise it may happen
our submitted IO operations have been already dispatched
and this call then endlessly waits for IO which are all done.
This can be reproduced when device returns quickly errors
on write requests.

3 years agoconfigure: use our ordered list of python names
Zdenek Kabelac [Fri, 2 Oct 2020 18:40:52 +0000 (20:40 +0200)]
configure: use our ordered list of python names

Since it seems it's prefered now to use python3 in path name,
prefer this name as first in the list.

3 years agoconfigure: update with latest AM_PATH_PYTHON
Zdenek Kabelac [Fri, 2 Oct 2020 18:21:00 +0000 (20:21 +0200)]
configure: update with latest AM_PATH_PYTHON

World has moved towards python3.9.
Although we still don't like path ordering.

3 years agoconfigure: check for BLKZEROOUT support
Zdenek Kabelac [Fri, 2 Oct 2020 16:39:19 +0000 (18:39 +0200)]
configure: check for BLKZEROOUT support

3 years agolvconvert: move log message to fix segfault
David Teigland [Fri, 2 Oct 2020 14:23:25 +0000 (09:23 -0500)]
lvconvert: move log message to fix segfault

log message was printing lv name from released vg

3 years agoimprove message for invalid device arg in process_each_pv
David Teigland [Thu, 1 Oct 2020 17:34:36 +0000 (12:34 -0500)]
improve message for invalid device arg in process_each_pv

Multiple commands process pvs by name using process_each_pv()
and will now have an improved error message for a device
that's excluded by filters.

3 years agoimprove message for invalid device arg
David Teigland [Thu, 1 Oct 2020 17:19:27 +0000 (12:19 -0500)]
improve message for invalid device arg

for pvcreate, pvremove, vgcreate, vgextend.

3 years agodevices: support printing the filter that rejects a device
David Teigland [Mon, 20 Jul 2020 17:48:36 +0000 (12:48 -0500)]
devices: support printing the filter that rejects a device

Use of this new message function needs to be added
to various commands to improve the output.

3 years agotests: enable writecache test that uses cleaner
David Teigland [Mon, 22 Jun 2020 16:52:14 +0000 (11:52 -0500)]
tests: enable writecache test that uses cleaner

3 years agowritecache: use two step detach
David Teigland [Thu, 11 Jun 2020 18:33:40 +0000 (13:33 -0500)]
writecache: use two step detach

When detaching a writecache, use the cleaner setting
by default to writeback data prior to suspending the
lv to detach the writecache.  This avoids potentially
blocking for a long period with the device suspended.

Detaching a writecache first sets the cleaner option, waits
for a short period of time (less than a second), and checks
if the writecache has quickly become clean.  If so, the
writecache is detached immediately.  This optimizes the case
where little writeback is needed.

If the writecache does not quickly become clean, then the
detach command leaves the writecache attached with the
cleaner option set.  This leaves the LV in the same state
as if the user had set the cleaner option directly with
lvchange --cachesettings cleaner=1 LV.

After leaving the LV with the cleaner option set, the
detach command will wait and watch the writeback progress,
and will finally detach the writecache when the writeback
is finished.  The detach command does not need to wait
during the writeback phase, and can be canceled, in which
case the LV will remain with the writecache attached and
the cleaner option set.  When the user runs the detach
command again it will complete the detach.

To detach a writecache directly, without using the cleaner
step (which has been the approach previously), add the
option --cachesettings cleaner=0 to the detach command.

3 years agopvcreate/pvremove: reimplement device checks
David Teigland [Tue, 23 Jun 2020 18:19:11 +0000 (13:19 -0500)]
pvcreate/pvremove: reimplement device checks

Reorganize checking the device args for pvcreate/pvremove
to prepare for future changes.  There should be no change
in behavior.  Stop the inverted use of process_each_pv,
which pulled in a lot of unnecessary processing, and call
the check functions on each device directly.

3 years agotest: grep -q may fail and it does
Marian Csontos [Thu, 1 Oct 2020 09:33:57 +0000 (11:33 +0200)]
test: grep -q may fail and it does

The script runs with pipefail, grep -q exits immediately sending SIGPIPE
to lvm segtype which fails whole pipe.

3 years agolvmlockd vdo: add support
David Teigland [Tue, 29 Sep 2020 19:33:44 +0000 (14:33 -0500)]
lvmlockd vdo: add support

lvmlockd handling for vdo lv and vdo pool is like
thin lv and thin pool.

3 years agolvmlockd vdo: disallow use of shared lock on LV
David Teigland [Mon, 28 Sep 2020 18:48:46 +0000 (13:48 -0500)]
lvmlockd vdo: disallow use of shared lock on LV

vdo cannot be active on multiple hosts concurrently

3 years agotests: thin-flags
Zdenek Kabelac [Sat, 26 Sep 2020 23:24:17 +0000 (01:24 +0200)]
tests: thin-flags

3 years agodebug: remove stacktrace on regular path
Zdenek Kabelac [Sat, 26 Sep 2020 12:52:27 +0000 (14:52 +0200)]
debug: remove stacktrace on regular path

Here _insert is expected to also fail, so just regular 'return 0'.

3 years agodebug: update debug message
Zdenek Kabelac [Sat, 26 Sep 2020 12:54:50 +0000 (14:54 +0200)]
debug: update debug message

3 years agoactive: fix compilation without devmapper
Zdenek Kabelac [Mon, 28 Sep 2020 16:56:58 +0000 (18:56 +0200)]
active: fix compilation without devmapper

Better support for compilation without device-mapper.

3 years agothin: remove unneeded code test
Zdenek Kabelac [Sun, 27 Sep 2020 00:20:50 +0000 (02:20 +0200)]
thin: remove unneeded code test

Since we detect already transaction if before starting
to build dm tree - this extra check is a duplicate
that would only capture very tiny 'race' and we later
validate transaction_id with suspended snapshot origin.

3 years agothin: validate thin-pool state before sending messages
Zdenek Kabelac [Mon, 28 Sep 2020 21:12:48 +0000 (23:12 +0200)]
thin: validate thin-pool state before sending messages

Alhtough lvm2 does validation on its side, ensure DM code
is not sending messages to failed thin pool.

3 years agothin: use lv_status_thin and lv_status_thin_pool
Zdenek Kabelac [Sat, 26 Sep 2020 23:11:47 +0000 (01:11 +0200)]
thin: use lv_status_thin and lv_status_thin_pool

Introduce structures lv_status_thin_pool and
lv_status_thin  (pair to lv_status_cache, lv_status_vdo)

Convert lv_thin_percent() -> lv_thin_status()
and  lv_thin_pool_percent() + lv_thin_pool_transaction_id() ->
lv_thin_pool_status().

This way a function user can see not only percentages, but also
other important status info about thin-pool.

TODO:
This patch tries to not change too many other things,
but pool_below_threshold() now uses new thin-pool info to return
failure if thin-pool cannot be actually modified.
This should be handle separately in a better way.

3 years agowritecache: archive before modification of metadata
Zdenek Kabelac [Mon, 28 Sep 2020 17:17:54 +0000 (19:17 +0200)]
writecache: archive before modification of metadata

Archive before we start to modify metadata.

3 years agocleanup: avoid unneeded check
Zdenek Kabelac [Sat, 26 Sep 2020 17:32:52 +0000 (19:32 +0200)]
cleanup: avoid unneeded check

Since creation of thin snapshot already makes sure,
the message list is empty, there is no need to check
this again.

3 years agoactivation: move locking of critical section
Zdenek Kabelac [Sat, 26 Sep 2020 12:56:44 +0000 (14:56 +0200)]
activation: move locking of critical section

Move begining of 'suspending' critical section closer to _lv_suspend_lv()
for better correctness of error paths.

3 years agoconfigure: update help
Zdenek Kabelac [Mon, 28 Sep 2020 16:51:32 +0000 (18:51 +0200)]
configure: update help

Help shows new defaults.

3 years agoconfigure: editline updates
Zdenek Kabelac [Tue, 29 Sep 2020 08:15:45 +0000 (10:15 +0200)]
configure: editline updates

Update configure file.

3 years agolvm: add readline alternative editline
Bastian Germann [Sat, 26 Sep 2020 19:32:55 +0000 (21:32 +0200)]
lvm: add readline alternative editline

LVM2 is distributed under GPLv2 only. The readline library changed its
license long ago to GPLv3. Given that those licenses are incompatible
and you follow the FSF in their interpretation that dynamically linking
creates a derivative work, distributing LVM2 linked against a current
readline version might be legally problematic.

Add support for the BSD licensed editline library as an alternative for
readline.

Link: https://thrysoee.dk/editline
3 years agotests: add case for metadata checksum differences
David Teigland [Mon, 28 Sep 2020 18:21:44 +0000 (13:21 -0500)]
tests: add case for metadata checksum differences

Cover the case where two copies of metadata have the
same seqno but different checksums.  Also elaborate
on an existing fixme in the code for this case, since
we should be doing something better for this case.

This had been uncovering an issue with reopening
fds in readwrite mode.

3 years agolvpoll: don't use hints
David Teigland [Fri, 25 Sep 2020 17:29:10 +0000 (12:29 -0500)]
lvpoll: don't use hints

There's a bug when lvpoll attempts to write new hints,
related to the fact that lvpoll does not follow the same
scanning process as standard commands.
Fix by disabling the use of hints in lvpoll.  We may want
to renable hints in lvpoll in a way that they can be used,
if valid, but not updated if they don't exist or are invalid.

3 years agoscanning: keep open an lvm device with scanning problem
David Teigland [Fri, 25 Sep 2020 16:52:55 +0000 (11:52 -0500)]
scanning: keep open an lvm device with scanning problem

The command may want to update it.

3 years agodevices: fix reopen for unopened device
David Teigland [Fri, 25 Sep 2020 16:59:49 +0000 (11:59 -0500)]
devices: fix reopen for unopened device

If there's a request to reopen rw a device that's not
open, then just call the normal open function.

3 years agoRevert "lvconvert: display warning if raid1 LV image count does not change"
Heinz Mauelshagen [Mon, 28 Sep 2020 15:14:03 +0000 (17:14 +0200)]
Revert "lvconvert: display warning if raid1 LV image count does not change"

This reverts superfluous commit 3c9177fdc0b8f94c0ae335790a485477901b685d as
_lv_raid_change_image_count() already checks for non-changed image count.

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

3 years agotests: add small delay
Zdenek Kabelac [Wed, 23 Sep 2020 20:09:37 +0000 (22:09 +0200)]
tests: add small delay

Prevent there is no i.e. udev trying to open our device.

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