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

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

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

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

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

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

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

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

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

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

4 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

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

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

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

4 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

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

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

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

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

4 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

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

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

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

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

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

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

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

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

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

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

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

Help shows new defaults.

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

Update configure file.

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

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

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

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

4 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

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

4 years agotests: also add thick snap of thin volume
Zdenek Kabelac [Thu, 24 Sep 2020 18:49:52 +0000 (20:49 +0200)]
tests: also add thick snap of thin volume

4 years agotests: check some common errors
Zdenek Kabelac [Fri, 25 Sep 2020 20:47:19 +0000 (22:47 +0200)]
tests: check some common errors

Collect some cases users are hitting when working
with thin-pools which has mismatching kernel metadata content with
lvm2 metadata.

4 years agotests: vgsplit of vdo volumes
Zdenek Kabelac [Thu, 24 Sep 2020 19:50:50 +0000 (21:50 +0200)]
tests: vgsplit of vdo volumes

4 years agomakefiles: document supported var in make help
Zdenek Kabelac [Thu, 24 Sep 2020 13:14:44 +0000 (15:14 +0200)]
makefiles: document supported var in make help

4 years agothin: pass through whole code
Zdenek Kabelac [Fri, 25 Sep 2020 12:34:49 +0000 (14:34 +0200)]
thin: pass through whole code

Instead of early 'return 0' let the whole code finish
in case of an error with syncing.

4 years agodevice_mapper: enhance error message
Zdenek Kabelac [Fri, 25 Sep 2020 17:10:30 +0000 (19:10 +0200)]
device_mapper: enhance error message

4 years agothin: improve error message
Zdenek Kabelac [Fri, 25 Sep 2020 20:42:22 +0000 (22:42 +0200)]
thin: improve error message

Add more info, explaing why the suspend of thin snapshot origin was omitted.

4 years agothin: enhance lvcreate error paths
Zdenek Kabelac [Fri, 25 Sep 2020 20:43:57 +0000 (22:43 +0200)]
thin: enhance lvcreate error paths

Improve error response and reporting, when creating thin snapshots.
If the thin pool kernel metadata already have device with ID lvm2
tries to create, give more meanigful error message and also properly
restore transaction id to the value known to thin-pool in this case.

Before it's been possible to divert by one from kernel TID value,
and lvm2 stacked delete message for such thin device.

4 years agothin: no delete message for device_id 0
Zdenek Kabelac [Fri, 25 Sep 2020 20:42:53 +0000 (22:42 +0200)]
thin: no delete message for device_id 0

Since we always use device_id > 0, we could use
device_id == 0 to actually mark thinLV as an
LV we want to remove without delete message.

4 years agovgsplit: support for VDO volumes
Zdenek Kabelac [Thu, 24 Sep 2020 18:49:18 +0000 (20:49 +0200)]
vgsplit: support for VDO volumes

Enable support and ensure VDO always moves with VDOPOOL.

4 years agotests: basic test for vdo on raid LV
Zdenek Kabelac [Wed, 23 Sep 2020 12:48:17 +0000 (14:48 +0200)]
tests: basic test for vdo on raid LV

Check stacing of VDO on top of raid LV works.

4 years agotests: add check for rename of cached vdopool
Zdenek Kabelac [Wed, 23 Sep 2020 11:22:08 +0000 (13:22 +0200)]
tests: add check for rename of cached vdopool

4 years agotests: a bit bigger mirrors
Zdenek Kabelac [Wed, 23 Sep 2020 12:06:19 +0000 (14:06 +0200)]
tests: a bit bigger mirrors

Seems even with throttling we occasinally need slightly more.

4 years agolvconvert: suppport vdo raid conversion also through vpool
Zdenek Kabelac [Wed, 23 Sep 2020 12:44:44 +0000 (14:44 +0200)]
lvconvert: suppport vdo raid conversion also through vpool

User could directly use 'vdopool' LV name for conversion into raid.
(lvconvert --type raid1 vg/vdopool)

4 years agovdo: allow passing renamed vdopool name to kernel
Zdenek Kabelac [Wed, 23 Sep 2020 11:20:28 +0000 (13:20 +0200)]
vdo: allow passing renamed vdopool name to kernel

Although kernel does not allow to load a new dm table
with renamed vdopool, at least make lvm2 code ready
it it every will get supported.

4 years agovdo: disable support for online rename of vdopool LV
Zdenek Kabelac [Wed, 23 Sep 2020 11:18:23 +0000 (13:18 +0200)]
vdo: disable support for online rename of vdopool LV

Since ATM kernel does not support this operation,
disable 'lvrename' of an active vdopool.

As a workaround, user may simply deactivate, rename and activate.

4 years agotests: use aux wrapper and add more notes
Zdenek Kabelac [Tue, 22 Sep 2020 14:27:21 +0000 (16:27 +0200)]
tests: use aux wrapper and add more notes

This test seems to be hitting some corner case in handling
out-of-metadata space condintion in thin-pool.

Add few more aid notes and functionality.

Also add missing '|| true' with now direct-IO dd command.

4 years agotests: move function to aux for reuse
Zdenek Kabelac [Tue, 22 Sep 2020 21:37:50 +0000 (23:37 +0200)]
tests: move function to aux for reuse

4 years agotests: update test
Zdenek Kabelac [Tue, 22 Sep 2020 21:26:28 +0000 (23:26 +0200)]
tests: update test

Shorten running time of the test.
Fix some issues in invoked resizing script to it returns
correct return code and dmeventd can be a little bit quicker
in this test.

4 years agotests: check vdopool policy extension
Zdenek Kabelac [Tue, 22 Sep 2020 13:44:31 +0000 (15:44 +0200)]
tests: check vdopool policy extension

Check pool will grow even with small policy amount.

4 years agovdo: enhance vdo pool extension
Zdenek Kabelac [Tue, 22 Sep 2020 21:25:58 +0000 (23:25 +0200)]
vdo: enhance vdo pool extension

When user tries to extend vdo pool - he needs to go always
at least by 1 full VDO slab  (defined as  vdo_slab_size_mb).

To avoid all trouble around find 'workable' size - lvm2 automatically
increases the passed (or by --use-policies calculated) extension size
(and informs a user about sometimes possibly large increase as slab
size can go upto 32GiB)

With VDO users need to always 'think-big' anyway and expect such
operation to be in GiB domain range.

4 years agovdo: extend vdo segment validation
Zdenek Kabelac [Tue, 22 Sep 2020 21:17:54 +0000 (23:17 +0200)]
vdo: extend vdo segment validation

Try to catch all suspicious VDO segments in metadata early.

4 years agovdo: correct message about policy extend support
Zdenek Kabelac [Tue, 22 Sep 2020 21:16:11 +0000 (23:16 +0200)]
vdo: correct message about policy extend support

Policy extend is already supported for vdo pools as well,
so correct the error message.

4 years agovdo: drop unnecessary tabulator from metadata output
Zdenek Kabelac [Tue, 22 Sep 2020 18:38:07 +0000 (20:38 +0200)]
vdo: drop unnecessary tabulator from metadata output

4 years agoactivation: use revert_lv on tree suspend failure
Zdenek Kabelac [Tue, 22 Sep 2020 11:35:27 +0000 (13:35 +0200)]
activation: use revert_lv on tree suspend failure

When thetable reload fails during suspend() - we were only calling
plain resume() - and this will reload only those devices,
which were left suspend, but will not try to restore
metadata state according to lvm2 reverted metadata.
So if we were reloading device tree - we have restored
only top-level LV and rest of reverted device manipulation
were left alone and possibly mismatched what is in committed
metadata.

FIXME: There are several cases were such revert will likely not work
properly anyway as some operation are currenly handled in single commit,
while they need multiple commits, but it's step towards better correctness.
At least we catch there errors now earlier.

4 years agotests: fix cleanup for unbound variables
Zdenek Kabelac [Sat, 19 Sep 2020 22:32:26 +0000 (00:32 +0200)]
tests: fix cleanup for unbound variables

When loop can't handle sector-size option - failure caused double fail
for access of unbound variable
Also fix expression for 'rm' and remove loops after loop release.

4 years agotests: add FIXME case
Zdenek Kabelac [Sat, 19 Sep 2020 22:01:48 +0000 (00:01 +0200)]
tests: add FIXME case

4 years agotests: use DIRECT io for zeroing whenver we can
Zdenek Kabelac [Sat, 19 Sep 2020 21:25:11 +0000 (23:25 +0200)]
tests: use DIRECT io for zeroing whenver we can

Performance with direct I/O here is noticable better,
so use it instead of buffered write whenever we can.

4 years agotests: use 4K with mkfs.xfs
Zdenek Kabelac [Sat, 19 Sep 2020 21:58:30 +0000 (23:58 +0200)]
tests: use 4K with mkfs.xfs

If the test runs of loop device backend with 512 sectors,
xfs selects this smaller sector size and then data do not fit
(we would need -l9 with most of 'raids').
With 4K sectors data always fits.

4 years agotests: skip with fail of first prepare_scsi
Zdenek Kabelac [Sat, 19 Sep 2020 21:03:06 +0000 (23:03 +0200)]
tests: skip with fail of first prepare_scsi

4 years agotests: check for cvol
Zdenek Kabelac [Sat, 19 Sep 2020 21:02:17 +0000 (23:02 +0200)]
tests: check for cvol

Check for cvol.
Add check for cmeta.

4 years agobache: fix error return value
Zdenek Kabelac [Sat, 19 Sep 2020 21:00:50 +0000 (23:00 +0200)]
bache: fix error return value

Return 0 as failure (as checked for).
Also add INTERNAL_ERROR if  'DI' would be -1.

4 years agotests: use parametrized function
Zdenek Kabelac [Sat, 19 Sep 2020 14:51:01 +0000 (16:51 +0200)]
tests: use parametrized function

Shorten and make the test easily readable by moving same code into
function and removed one duplicated test for 512,4096 combination.

Always use scsi_debug - since default ramdisk or loop device backend
is unpredictible.

4 years agotests: use zero backend
Zdenek Kabelac [Sat, 19 Sep 2020 13:58:11 +0000 (15:58 +0200)]
tests: use zero backend

Since we are not reading read - just use zero device as backend for
test, so we do not eat real disk space.

4 years agotests: use faster awk generator
Zdenek Kabelac [Sat, 19 Sep 2020 13:57:29 +0000 (15:57 +0200)]
tests: use faster awk generator

Shortens log length.

4 years agotests: ensure mnt is defined before trap install
Zdenek Kabelac [Fri, 18 Sep 2020 19:59:24 +0000 (21:59 +0200)]
tests: ensure mnt is defined before trap install

4 years agotests: reduce disk usage
Zdenek Kabelac [Fri, 18 Sep 2020 19:59:02 +0000 (21:59 +0200)]
tests: reduce disk usage

4 years agometadata: open rw fd before closing ro fd
David Teigland [Fri, 18 Sep 2020 19:42:23 +0000 (14:42 -0500)]
metadata: open rw fd before closing ro fd

lvm opens devices readonly to scan them, but
needs to open then readwrite to update the metadata.
Previously, the ro fd was closed before the rw fd
was opened, leaving a small gap where the dev was
not held open, and during which the dev could
possibly change which storage it referred to.

With the bcache_change_fd() interface, lvm opens a
rw fd on a device to be written, tells bcache to
change to the new rw fd, and closes the ro fd.

. open dev ro
. read dev with the ro fd (label_scan)
. lock vg (ex for writing)
. open dev rw
. close ro fd
. rescan dev to check if the metadata changed
  between the scan and the lock
. if the metadata did change, reread in full
. write the metadata

4 years agobcache: use indirection table for fd
David Teigland [Thu, 17 Sep 2020 14:40:18 +0000 (09:40 -0500)]
bcache: use indirection table for fd

Add a "device index" (di) for each device, and use this
in the bcache api to the rest of lvm.  This replaces the
file descriptor (fd) in the api.  The rest of lvm uses
new functions bcache_set_fd(), bcache_clear_fd(), and
bcache_change_fd() to control which fd bcache uses for
io to a particular device.

. lvm opens a dev and gets and fd.
  fd = open(dev);

. lvm passes fd to the bcache layer and gets a di
  to use in the bcache api for the dev.
  di = bcache_set_fd(fd);

. lvm uses bcache functions, passing di for the dev.
  bcache_write_bytes(di, ...), etc.

. bcache translates di to fd to do io.

. lvm closes the device and clears the di/fd bcache state.
  close(fd);
  bcache_clear_fd(di);

In the bcache layer, a di-to-fd translation table
(int *_fd_table) is added.  When bcache needs to
perform io on a di, it uses _fd_table[di].

In the following commit, lvm will make use of the new
bcache_change_fd() function to change the fd that
bcache uses for the dev, without dropping cached blocks.

4 years agotests: printf to awk
Zdenek Kabelac [Fri, 18 Sep 2020 15:27:17 +0000 (17:27 +0200)]
tests:  printf to awk

Shorten trace logs.

4 years agotests: update integrity-dmeventd
Zdenek Kabelac [Fri, 18 Sep 2020 14:56:00 +0000 (16:56 +0200)]
tests: update integrity-dmeventd

Use tee.
Switch to more simple generator with awk
(which doesn't produce long debug trace)
Sync before sleep to provoke raid action.

4 years agotests: enhance low-disk-space behavior
Zdenek Kabelac [Fri, 18 Sep 2020 12:32:15 +0000 (14:32 +0200)]
tests: enhance low-disk-space behavior

Use new SKIP_WITH_LOW_SPACE and set higher requirement for free space.

But still this test can't run on system's tmpfs directories -
as they typically provide less then 2G of space and when the test
runs there it also provisioning for all READ pages!)
BRD (ramdisk) device should work.

Extend a _wait_recalc() loop for slower hw.
When creating large raid which do not need to be fully synchronized use
them on delay devices - so even less data needs read/write.
Remove unneeded lvchange as lvcreate is already leaving LV inactive.
Replace printf with awk as generator.

mm

4 years agotests: inittest supports SKIP_WITH_LOW_SPACE
Zdenek Kabelac [Fri, 18 Sep 2020 12:25:50 +0000 (14:25 +0200)]
tests: inittest supports SKIP_WITH_LOW_SPACE

Test can set individually a higher value for required free space on
storage.

Note: it is not fully reliable since when 'brd' (ramdisk) device is used
this free space value is rather meanigul, but it might help
in case where a real filesystem is doing back-end for test devices.

4 years agotests: utils better handle ouf of disk space
Zdenek Kabelac [Fri, 18 Sep 2020 12:29:15 +0000 (14:29 +0200)]
tests: utils better handle ouf of disk space

When the test exhausts all the available free space on storage device,
then during the fail we cannot write anything as well - yet
the teardown needs to finish it's work - otherwise we leave
basicaly overfilled filesystem for all remaining tests.

4 years agotests: aux better handle invalid table
Zdenek Kabelac [Fri, 18 Sep 2020 12:23:20 +0000 (14:23 +0200)]
tests: aux better handle invalid table

In cases where internal functions like zero_dev, delay_dev pass-in
invalid parameter so resulting table can't work, resume at least
previous table line before failing out - so the cleaning process
later on is not stuck waiting on a suspended device.

4 years agotests: also use sed to shorten log output
Zdenek Kabelac [Thu, 17 Sep 2020 22:31:59 +0000 (00:31 +0200)]
tests: also use sed to shorten log output

4 years agotests: resolve missing removal of loopdevice on error path
Zdenek Kabelac [Thu, 17 Sep 2020 22:31:11 +0000 (00:31 +0200)]
tests: resolve missing removal of loopdevice on error path

In case of test failure, loop device leaked and occupied space forever.

4 years agotests: bigger data still needed for 0.7.0
Zdenek Kabelac [Thu, 17 Sep 2020 21:26:03 +0000 (23:26 +0200)]
tests: bigger data still needed for 0.7.0

4 years agotests: lower memory usage
Zdenek Kabelac [Thu, 17 Sep 2020 21:25:23 +0000 (23:25 +0200)]
tests: lower memory usage

Reduce memory needed by test at one time.

4 years agoconfigure: enable integrity by default
David Teigland [Wed, 16 Sep 2020 20:14:51 +0000 (15:14 -0500)]
configure: enable integrity by default

4 years agohints: enhance debug messages
David Teigland [Wed, 16 Sep 2020 19:46:50 +0000 (14:46 -0500)]
hints: enhance debug messages

4 years agolabel: cleanup set_byte error exit
David Teigland [Wed, 16 Sep 2020 18:54:16 +0000 (13:54 -0500)]
label: cleanup set_byte error exit

4 years agoRevert "label: use formaters FMTu64 and FMTsize_t"
David Teigland [Wed, 16 Sep 2020 18:47:06 +0000 (13:47 -0500)]
Revert "label: use formaters FMTu64 and FMTsize_t"

This reverts commit d0ccb2521ba4f34455078f87f46cc41f5761ffc0.

4 years agotests: smaller delay and lowered version
Zdenek Kabelac [Wed, 16 Sep 2020 11:21:16 +0000 (13:21 +0200)]
tests: smaller delay and lowered version

See if this will still work. Some boxes are delayed too much.
Also try to check for raid extend progress from version 1.13.

4 years agotests: fix bash regex syntax
Zdenek Kabelac [Wed, 16 Sep 2020 11:12:17 +0000 (13:12 +0200)]
tests: fix bash regex syntax

Typo before last commit.

4 years agotests: switch for checking version of installed tools
Zdenek Kabelac [Mon, 14 Sep 2020 19:25:04 +0000 (21:25 +0200)]
tests: switch for checking version of installed tools

It looks like older tools were compacting metadata more.

4 years agotests: skip kernel for this test
Zdenek Kabelac [Mon, 14 Sep 2020 19:23:16 +0000 (21:23 +0200)]
tests: skip kernel for this test

Kills this kernel ATM

4 years agolabel: use formaters FMTu64 and FMTsize_t
Zdenek Kabelac [Tue, 15 Sep 2020 19:47:39 +0000 (21:47 +0200)]
label: use formaters FMTu64 and FMTsize_t

Produces code without casts to differntly signed types
and also shortens and enhances readbility.

4 years agowipe: dev_set_bytes resolves zeroing
Zdenek Kabelac [Tue, 15 Sep 2020 18:35:48 +0000 (20:35 +0200)]
wipe: dev_set_bytes resolves zeroing

Since dev_write_zeros() is just subset of dev_set_bytes()
use it directly and simplify code.

4 years agowipe: convert zero_value to uint8_t
Zdenek Kabelac [Tue, 15 Sep 2020 14:40:53 +0000 (16:40 +0200)]
wipe: convert zero_value to uint8_t

We always write this value as byte.

4 years agowipe: zeroing of 8 sectors is granted
Zdenek Kabelac [Tue, 15 Sep 2020 14:38:50 +0000 (16:38 +0200)]
wipe: zeroing of 8 sectors is granted

With do_zero min is always 8 sectors, so use 0 as default.

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