1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

16063 Commits

Author SHA1 Message Date
Marian Csontos
d1db024e16 tests: fix unbound variable
Test `aux kernel_at_least 5 1` fails even for newer kernel
with `$3: unbound variable` when using `set -u`.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
6b3d0166ee tests: aux setup
Avoid endless loop if there was no 'remove' progress.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
4d8d8856f1 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.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
bd860802d4 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.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
1d7d3db571 tests: add small delay
Prevent there is no i.e. udev trying to open our device.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
2de99760f7 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.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
c380d4e9e2 tests: also add thick snap of thin volume 2020-10-16 18:09:55 +02:00
Zdenek Kabelac
e05c882ab5 tests: a bit bigger mirrors
Seems even with throttling we occasinally need slightly more.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
d76b5f4308 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.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
de1b894337 tests: move function to aux for reuse 2020-10-16 18:09:55 +02:00
Zdenek Kabelac
c68380746a debug: no backtrace
As the path already printed verbose message drop backtrace.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
b97440290c debug: show actually reason for taking this code path
Instead of not so useful backtrace, report what was the reason.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
03bddd7d41 debug: remove stacktrace on regular path
Here _insert is expected to also fail, so just regular 'return 0'.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
e8df503885 bcache: use flexible arrays
Cleanup, allocate whole struct with a single malloc call.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
479f0822ad 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.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
5e64aa222b 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.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
d32ee355c7 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.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
1ed9cfad09 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.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
305e80fe85 configure: update with latest AM_PATH_PYTHON
World has moved towards python3.9.
Although we still don't like path ordering.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
3b5d51e821 configure: update help
Help shows new defaults.
2020-10-16 18:09:54 +02:00
Zdenek Kabelac
7d6dfe9019 active: fix compilation without devmapper
Better support for compilation without device-mapper.
2020-10-16 18:09:54 +02:00
Zdenek Kabelac
0a82573416 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.
2020-10-16 18:09:54 +02:00
Zdenek Kabelac
45121aafe9 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
3094c423a0 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
6373a84977 activation: move locking of critical section
Move begining of 'suspending' critical section closer to _lv_suspend_lv()
for better correctness of error paths.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
d4d3ff352f makefiles: document supported var in make help 2020-10-16 17:07:59 +02:00
Zdenek Kabelac
8a0f9537f1 thin: pass through whole code
Instead of early 'return 0' let the whole code finish
in case of an error with syncing.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
3a2ada80cb thin: improve error message
Add more info, explaing why the suspend of thin snapshot origin was omitted.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
22b256a09a 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
9e8016ffa9 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
5726b93709 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
05ba12350c 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
688c72411e 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
cd681efd9f 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
3f06b5c39c 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
276e22e263 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
f9327d040c 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.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
238da8ddd9 lvcreate: add extra synchronization at error path
Put explict udev synchronization before we try to deactive devices.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
b490cddfbc tests: switch for checking version of installed tools
It looks like older tools were compacting metadata more.
2020-10-16 17:07:59 +02:00
Wu Guanghao
844037ecdf pvmove: check return value of top_level_lv_name()
The return value of top_level_lv_name() may be NULL, so we should
check return value of top_level_lv_name before calling
strcmp(lv->name, top_level_lv_name(vg, lv_name)).

Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2020-10-16 17:07:59 +02:00
Zhao Heming
5b579fa796 gitignore: ignore all cscope generated files
When using cscope to read code, it will generate below 3 files for speedup
cross-refer: cscope.files, cscope.in.out, cscope.po.out

The .gitignore only contains "/cscope.out". It a little bit messy when
executing 'git status', and other git commands.
This patch add all cscope generated files in .gitignore.

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
2020-10-16 17:07:59 +02:00
David Teigland
9345b9cb26 devices: simplify md superblock checking code 2020-10-16 17:07:59 +02:00
David Teigland
57ddaaa47d devices: detect md ddf and imsm superblocks 2020-10-16 17:07:59 +02:00
Zhao Heming
db7aef215a dev-cache: dev->bcache_fd default from 0 to -1
This fix can avoid bcache_fd will mistakenly open/close in later.

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
2020-10-16 17:07:59 +02:00
David Teigland
667cfeeacf vgrename: fix error value when name exists 2020-10-16 17:07:59 +02:00
Zdenek Kabelac
d1f7c531eb tests: improve cache abort test
Use bigger volume and slowdown writing to cache device.
This allows more simple to reach 'dirty' state.
Also document exactly 1 SIGINT has to fire aborting of flushing.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
4ebc8875d3 tests: check in_sync prints also dm status
It's more useful to see how the progress of status checking is moving.
2020-10-16 17:07:59 +02:00
Zdenek Kabelac
0881ba9e9f cache: simplier signal handling
Use just single sigint_allow()/restore() within flushing loop
and void one extra signal manipulation.
2020-10-16 17:07:59 +02:00
Marian Csontos
de17c273de README: update 2020-10-16 17:07:58 +02:00
Zdenek Kabelac
ff75d40298 cov: drop checking for EWOULDBLOCK
Reduce cov warning and remove this really ancient define
as lvm2 was never compilable on such platform.
2020-10-16 17:07:58 +02:00