1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

17047 Commits

Author SHA1 Message Date
Zdenek Kabelac
2101e324f9 locking: restore blocking signal for VG_GLOBAL lck
During removal of a lot of locking code the signal blocking got lost
and signal processing got broken leading to unpredictable
behavior of i.e. activation code the can get interrupted in the
middle of DM table processing.

lvm2 code always expects signals are blocked while lock is held
unless it is explictelly placed into section of:
sigint_allow();....;sigint_restore();
For checking catched interrupt there is sigint_catched();
2020-09-14 00:15:14 +02:00
Zdenek Kabelac
fe77d1a710 tests: avoid using string
String 'TEST WARNING' may not be present in the test script itself.
Add '\ ' to avoid 'grep' matching test as the test with warning.
2020-09-12 13:24:03 +02:00
Zdenek Kabelac
3008e1be08 tests: support for 16T is needed
Likely 32bit machines can't pass here.
2020-09-12 13:24:03 +02:00
Zdenek Kabelac
17dbb24f7c tests: change skip to die for upstream crash
So the failing test is not lost from sight.
2020-09-12 13:24:03 +02:00
Zdenek Kabelac
7bd015861d tests: skip test on failing kernel 2020-09-12 13:24:03 +02:00
Zdenek Kabelac
a940979ff7 cov: drop checking for EWOULDBLOCK
Reduce cov warning and remove this really ancient define
as lvm2 was never compilable on such platform.
2020-09-12 13:24:03 +02:00
Zdenek Kabelac
740d5bf6cd cov: check sscanf result 2020-09-12 13:24:03 +02:00
Zdenek Kabelac
a5d45b237d cov: drop model for origin_from_cow 2020-09-12 13:23:49 +02:00
Zdenek Kabelac
a9cb96f146 lvconvert: check if LV has cow type
Cow may not be a COW type, the return value of origin_from_cow(cow) may be NULL.

Reported-by: Wu Guanghao <wuguanghao3@huawei.com>
Reported-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2020-09-12 12:55:20 +02:00
Zdenek Kabelac
463a61e62e revert "lvconvert: check if LV has snapshot type"
This reverts commit 7db124774a.
Actually we need to check for lv_is_cow().
2020-09-12 12:55:17 +02:00
Zdenek Kabelac
93e252c4a3 tests: check for boundary allocation sizes 2020-09-11 21:52:55 +02:00
Zdenek Kabelac
f84a7266bc tests: reduce disk space usage by pvck-dump
Lower disk usage for 'dd'.
2020-09-11 21:52:55 +02:00
Zdenek Kabelac
c9b40083fc tests: lower at_least to version 1.19
With this version already can be seen different metadata usage on
kernel side, so lower the target version.
2020-09-11 21:52:55 +02:00
Zdenek Kabelac
f233d9a909 tests: have_cache function checks for cache-pool
Check for cache-pool segment as plain cache can match writecache.
2020-09-11 21:52:55 +02:00
Zdenek Kabelac
77fdc17d70 alloc: improve estimation of sufficient_pes_free
Metadata size was calculated correctly only for raids.

Fixes problem for crash during lvcreate when thin-pool was created
on a VG where remaining free space had the size to only fit a single
metadata LV and not also its _pmspare.

Lvcreate crashed with this assert message:

lvcreate: metadata/pv_map.c:198: consume_pv_area: Assertion `to_go <= pva->count' failed.
Aborted (core dumped)

TODO: there is probably to large overload of several alloc_handle
variables.

Reported-by: Wu Guanghao<wuguanghao3@huawei.com>
Reported-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2020-09-11 21:51:24 +02:00
Wu Guanghao
7db124774a lvconvert: check if LV has snapshot type
Cow may not be a snapshot type, the return value of origin_from_cow(cow) may be NULL

Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2020-09-11 21:48:37 +02:00
Wu Guanghao
223b75ee91 lvconvert_poll: ensure LV has snapshot type
LV may not be a snapshot type, the return value of find_snapshot(lv) may be NULL.
Here, we will call stack if LV is not a snapshot type.

Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2020-09-11 21:47:34 +02:00
Wu Guanghao
d71199920f 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-09-11 21:43:08 +02:00
Zhao Heming
c38c4d9d36 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-09-11 21:42:38 +02:00
Zdenek Kabelac
9f78acfee9 thin: compensate metadata size by extra percent
When using --use-policy for automatic extension of thin-pool,
the extension of thin-pool's metadata itself can actually take
some extra space.
Since I'm not aware of exact compensation formula, add just
1% extra to calculated amount and hope it fits.

Wanted target is to always have usable thin-pool that fits
bellow pool_metadata_min_threshold().
2020-09-11 21:42:37 +02:00
Zdenek Kabelac
b798554a20 lv_manip: even better rounding 2020-09-11 13:37:04 +02:00
Zdenek Kabelac
3f2e9e3546 tests: aux collects stack trace when stuck is assumed
Automatically collect traces in this case.
2020-09-10 23:55:03 +02:00
Zdenek Kabelac
49d2b27a68 tests: adding "" around DM_DEV_DIR 2020-09-10 23:55:03 +02:00
Zdenek Kabelac
3dcd61d3d7 tests: disable dbustest with valgrind testing 2020-09-10 23:55:03 +02:00
Zdenek Kabelac
678951f635 cleanup: comment typo 2020-09-10 23:55:03 +02:00
Zdenek Kabelac
e7bd3ba22d debug: drop debug trace from regular path
Since we query on regular code these:
  lv_raid_has_integrity()
  lv_has_integrity_recalculate_metadata()
without prior checking for lv_is_raid() - these 'return 0' should
not use <stacktrace> as they are expected.
2020-09-10 23:55:03 +02:00
Zdenek Kabelac
bc09803628 lv_manip: relocate check to proper function 2020-09-10 23:54:33 +02:00
Zdenek Kabelac
e7f5acdfa6 lvextend: improve percentage estimation
Correcting rounding rules for percentage evaluation.

Validate supported range of percentage.
(although ranges are already validated earlier on code path)
2020-09-10 23:54:31 +02:00
Zdenek Kabelac
6d392776b0 configure: compile with vdo and writecache by default
Enable compilation of vdo and writecache support as internaly
supported segment types by default.

For disabling use:

--with-vdo=none
--with-writcache=none
2020-09-10 23:54:10 +02:00
David Teigland
1f54129c4e integrity: fix segfault reporting integrity for other lvs 2020-09-09 10:22:07 -05:00
Zdenek Kabelac
0210c7076d man: correcting vdo issues
Fixing reported bugs within provided examples - so examples
can be used via cut&paste.
2020-09-09 15:16:34 +02:00
Zdenek Kabelac
763342016c man: correctly use configured directories 2020-09-09 13:22:37 +02:00
Zdenek Kabelac
af33a00847 Revert "raid: add _rimage and _rmeta as origin_only"
This reverts commit 3388e19489.
More thinking needed.
2020-09-09 00:58:52 +02:00
Zdenek Kabelac
a8ea1817ab Revert "raid: do not enforce flushing of raids when it is not required"
This reverts commit ce5ea07411.
More thinking needed.
2020-09-09 00:58:32 +02:00
Zdenek Kabelac
bb62af5b3d tests: tune extend test
For proper checking of extension progress require version 1.15

It looks with older versoin extension happens during very slow
resume within lvm command - although speed is still somewhat slow
with latest version.
2020-09-08 21:23:03 +02:00
Zdenek Kabelac
676ce47754 tests: check for writecache being compiled in 2020-09-08 21:23:03 +02:00
Zdenek Kabelac
8dea63d30f tests: check for cache_version that supports v2 2020-09-08 21:23:03 +02:00
Zdenek Kabelac
ce5ea07411 raid: do not enforce flushing of raids when it is not required
This is probably somewhat experimantal patch - but when i.e. raid device
is just extend, there should not be a technical need for flush,
unless the target would stricly need it.  It should allow faster
processing of lvm command not being blocked by possibly longer flush.
2020-09-08 21:23:03 +02:00
Zdenek Kabelac
3388e19489 raid: add _rimage and _rmeta as origin_only
Since we do not support rimage & rmeta for snapshots - we can
avoid quering for -cow devices and add them as origin_only -
since their snapshots (-cow) could have never existed.
This redumes several ioctl operation during table preloading.
2020-09-08 21:23:03 +02:00
Zdenek Kabelac
3e6bb77228 lv_manip: add synchronization points 2020-09-08 21:23:03 +02:00
Zdenek Kabelac
8d6f1f9768 lvconvert: flip return value of _raid_split_image_conversion
Use '0' for error and '1' as success.
Also drop INTERNAL_ERROR from path - as this error
is ATM used for invalid devices.
(i.e. test lvconvert-raid1-split-trackchanges.sh)
2020-09-08 21:23:03 +02:00
David Teigland
dddf63ebc3 tests: fix pvck repair in hints.sh 2020-09-04 11:23:25 -05:00
Zdenek Kabelac
10fc3610c4 tests: use delayzero_dev
Speed-up a bit the first synchronization with just 50ms write delay,
but later set also delay on read to slowdown lvextend.

FIXME: there are still things to look at:

0 229376 raid raid1 2 AA 229376/229376 idle 0 0
0 229376 raid raid1 2 AA 0/229376 frozen 0 0 -
0 262144 raid raid1 2 AA 229376/262144 repair 0 0 -
0 262144 raid raid1 2 AA 229376/262144 repair 0 0 -
0 262144 raid raid1 2 AA 245888/262144 repair 0 0 -
2020-09-04 18:11:42 +02:00
Zdenek Kabelac
76b1f43e81 tests: add aux delayzero_dev support
Just like we have 'writeerror_dev' supporting creation of device
which 'readable' segment and segments where write will fail we
have now support for delay zero mappings.

This is useful if we want to 'fake' large writing areas where we do
not really care about the actual 'disk' content - since we test
operation logic and it doesn't matter we read and write zeroes.
With combination with 'delay' target we can create specific mappings
and avoid using large memory areas of ramdisk.
2020-09-04 18:11:42 +02:00
David Teigland
d8bb85d963 writecache: allow pvmove on origin
The removed check didn't actually prevent pvmoving the origin,
which was possible by naming the wcorig lv, or naming no lv.
2020-09-02 14:45:52 -05:00
David Teigland
f5a669f314 pvck: repair should clear hints
repairing a pv can cause the hint file to become incorrect
2020-09-02 14:21:17 -05:00
David Teigland
8b9028bbe7 hints: remove warning when clearing hint file
When the hint file cannot be accessed, silently
ignore hints, like other instances do.
2020-09-02 14:06:46 -05:00
David Teigland
d1019a6434 integrity: improve lv type checks 2020-09-02 12:40:45 -05:00
David Teigland
9a7b81fb72 integrity: fix segfault for lv with no seg
in lv_raid_has_integrity
2020-09-02 09:15:58 -05:00
David Teigland
739827ef1c tests: add new integrity reporting fields 2020-09-01 17:13:46 -05:00