1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-06 17:18:29 +03:00
Commit Graph

15853 Commits

Author SHA1 Message Date
Zdenek Kabelac
253d10f840 raid: better place for blocking reshapes
Still the place can be better to block only particular reshape
operations which ATM cause kernel problems.

We check if the new number of images is higher - and prevent to take
conversion if the volume is in use (i.e. thin-pool's data LV).

(cherry picked from commit 96985b1373)
2020-02-10 15:44:46 +01:00
wangjufeng
bcf9556b8f lvmetad: fix heap memory leak
error could be reproduced by calling pvs periodically:
    #!/bin/bash
    while :
    do
        pvs
        sleep 1
    done

use top command to watch RES memory of lvmetad. After a few minutes,
its RES memory will grow for a few KB. Then stop calling pvs, while
its RES will not decrease.

This is because, when lvmetad make reponse for clent request, it
will malloc new chunk for s->vgid_to_metadata, while actually the
new chunk should be added to the reponse dm_config_tree, or it will
make the chunk list of s->vgid_to_metadata keep growing.

Signed-off-by: wangjufeng <wangjufeng@huawei.com>
Reviewed-by: liuzhiqiang <liuzhiqiang26@huawei.com>
Reviewed-by: guiyao <guiyao@huawei.com>
2020-02-05 15:30:17 -06:00
Zdenek Kabelac
a1f06e2fae tests: partial revert of test change of b6e6ea2d65
With the update with commit b6e6ea2d65
the test file has been updated - however stable branch still has
clvmd & lvmetad so we want to omit runnig unit tests for these runs.
2020-01-21 17:07:20 +01:00
Zdenek Kabelac
62888e9c76 tests: skip test when dm-delay is not available 2020-01-21 16:49:53 +01:00
Zdenek Kabelac
5ab4d44a3b aux: writeerror_dev checks for delay target 2020-01-21 16:49:34 +01:00
Zdenek Kabelac
f8ef030737 raid: more limitted prohibition of stacked raid usage
We actually need to prohibit only reshaping cases which are
running over multiple commands.
2020-01-20 15:21:38 +01:00
Zdenek Kabelac
c66e015698 tests: add corruption write on PV test
Test a case where PV is readable, but fails on write updating.
Check the failure is reported only for a single PV.
2020-01-20 15:21:38 +01:00
Zdenek Kabelac
9b41118b9c tests: writeerror_dev
Intruduce aux function for easy simulation of disk areas,
that are 'normally' readable, but will fail on write.
2020-01-20 15:21:38 +01:00
Marian Csontos
440ced192a base: Get Makefile from master 2020-01-20 14:48:58 +01:00
Joe Thornber
d20490f76d [radix-tree] Add missing test case 2020-01-16 15:25:18 +00:00
Joe Thornber
019fa6f8ee [bcache] bcache_invalidate_fd, only remove prefixes on success. 2020-01-16 14:58:56 +00:00
Joe Thornber
1e2e12f19c [bcache] reverse earlier patch.
It broke some unit tests, for v. little benefit
2020-01-16 14:58:43 +00:00
Joe Thornber
6370c20d39 [bcache] pass up the error from io_submit rather than using generic -EIO
Author: Heming Zhao
2020-01-16 14:58:28 +00:00
Joe Thornber
056eb0a880 [bcache] add unit test
abort-forces-read
2020-01-16 14:58:12 +00:00
Joe Thornber
babde3da55 [label] Use bcache_abort_fd() to ensure blocks are no longer in the cache.
The return value from bcache_invalidate_fd() was not being checked.

So I've introduced a little function, _invalidate_fd() that always
calls bcache_abort_fd() if the write fails.
2020-01-16 14:57:49 +00:00
Joe Thornber
232f779db4 [bcache] add bcache_abort()
This gives us a way to cope with write failures.
2020-01-16 14:53:17 +00:00
Joe Thornber
b6e6ea2d65 [bcache] Bring bcache into sync with master branch 2020-01-16 14:20:35 +00:00
Joe Thornber
e552103027 [radix-tree] Bring radix-tree up to date with the master branch 2020-01-16 14:03:42 +00:00
Zdenek Kabelac
846ae8d49d WHATS_NEW: update 2020-01-13 17:41:44 +01:00
Zdenek Kabelac
c575c1c9ff vdo: avoid running initialization of cache pool vars
Since VDO is also pool, the old if() case missed to know about this,
and executed unnecesserily initialization of cache pool variables.
This was usually harmless when using 'smaller' sizes of VDO pools,
but for big VDO pool size, we were reporting senseless messages
about big cache chunk sizes.
2020-01-13 17:41:22 +01:00
Zdenek Kabelac
36210c2b49 raid: disallow reshape of stacked LVs
Until we resolve reshape for 'stacked' devices, we need to disable it.
So users can no longer reshape i.e. thin-pool data volumes, causing
ATM bad thin-pool problems.
2020-01-13 17:41:22 +01:00
Heinz Mauelshagen
50c56ade2a lvcreate: ensure striped raid region size is at least stripe size
The kernel MD runtime requires region size to be larger than stripe size
on striped raid layouts, thus the dm-raid target's constructor rejects
such request.

This causes e.g. an 'lvcreate --type raid10 -i3 -I4096 -R2048 -n lv vg' to fail.

Avoid failing late in the kernel by enforcing region size to be
larger or equal to stripe size.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1698225
2019-11-26 22:30:54 +01:00
Marian Csontos
61c321d110 test: Fix handling leftovers from previous tests
teardown fails current PREFIX is prefix of previously failed test with
leftovers in dmtable.

(cherry picked from commit 1e669ab315)
2019-11-20 15:31:21 +01:00
Marian Csontos
26f94d9119 WHATS_NEW: update 2019-11-20 15:30:34 +01:00
Marian Csontos
9e45ad04b0 build: autoconf 2019-11-20 15:27:42 +01:00
Heming Zhao
245d7fcd59 fix dev_unset_last_byte after write error
ev_unset_last_byte() must be called while the fd is still valid.
After a write error, dev_unset_last_byte() must be called before
closing the dev and resetting the fd.

In the write error path, dev_unset_last_byte() was being called
after label_scan_invalidate() which meant that it would not unset
the last_byte values.

After a write error, dev_unset_last_byte() is now called in
dev_write_bytes() before label_scan_invalidate(), instead of by
the caller of dev_write_bytes().

In the common case of a successful write, the sequence is still:
dev_set_last_byte(); dev_write_bytes(); dev_unset_last_byte();

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
2019-11-13 11:28:22 -06:00
Zdenek Kabelac
fa4ce13e3f tests: fix else path
Code when raid is present has some 'extra' effect that can't be skipped.
2019-11-11 18:00:27 +01:00
Zdenek Kabelac
c3aa2988d1 WHATS_NEW: update 2019-11-11 17:50:03 +01:00
Zdenek Kabelac
7581cc20c9 tests: add test of resize of different segtypes 2019-11-11 17:50:03 +01:00
Zdenek Kabelac
b9926fb1be lvextend: fix resizing volumes of different segtype
When resizing 2 volumes like  thin-pool and it's metadata and they
would be of a different type - command would be actually expecting
both LVs being of a same segtype - and would throw an error in
case they are different.

This patch fixes is by setting a new segtype from last segment of
2nd. extented device.

Also it fixes the possible 'percentage' extension setup that
might have been used for 'primary' volume - while the 'secondary'
LV always goes with direct size - as we do not support 'percentage'
setup for them

This affects maily usage of thin-pool where the extension of
thin-pool data size may also lead to extension of metadata size.
2019-11-11 17:48:49 +01:00
Zdenek Kabelac
2f615e73de tests: add extra settle
To avoid removing, while 'add' might not have been processed yet.
(when emulating reboot in pvmove-restart)
2019-11-08 15:12:51 +01:00
Zdenek Kabelac
0e3e974bff tests: skip unneeded status check
If 'remove' was succesful - we can break loop immediatelly.
2019-11-08 15:12:51 +01:00
Zdenek Kabelac
bbdcdc12b2 daemons: check for non-zero thread_id
Do not call pthread_join if thread_id would be 0.
2019-11-08 15:12:51 +01:00
Zdenek Kabelac
e9b2148dab daemon: better error path handling for shutdown
Report errors for open in better order.
Ensure descriptors are not leaked.
2019-11-08 15:12:51 +01:00
Zdenek Kabelac
34bde8b6c7 lvmcache: free resource on error path
Free allocated svg on error path.
Also explicitely ignore dm_strncpy() result.
(We know it will end with failure here.)
2019-11-08 15:11:50 +01:00
Zdenek Kabelac
f90c3d69ce cov: ensure read_ahead is available
Make sure read_ahead pointer is not NULL when quering for RA.
2019-11-08 13:04:45 +01:00
Zdenek Kabelac
67bdae0697 cov: missing checks of syscalls
Check for sigaction,sigprocmask,pthread_sigmask errors
2019-11-08 13:04:02 +01:00
Zdenek Kabelac
50fb24f5c2 gcc: avoid declartion shadowing
dev_name is global in device.h
2019-11-08 13:03:20 +01:00
Heinz Mauelshagen
ffd959d2c0 man: adjust 'disks' to 'devices' as used throughout 2019-11-07 17:47:35 +01:00
Zdenek Kabelac
343d80a7fe tests: be happy with less then 90 percent
Thin metadata evolve between kernel version, so it's not always
precisely predictible its usage - so let's met test happy,
when it gets bellow 90%.
2019-11-01 16:21:52 +01:00
Zdenek Kabelac
a611f24751 tests: larger are needs to be disabled
Since we 'disable' lvmetad via --repair of 'raid'
if such target is not present, we simply skip
all tests expecting disabled lvmetad.
2019-11-01 16:12:39 +01:00
Zdenek Kabelac
4ae481bb30 tests: skip test if scsi_debug is not available 2019-11-01 16:12:39 +01:00
Zdenek Kabelac
2cd30c0d44 tests: needs some raid
Add explicit check for at least 'some' raid being present.
Slowdown 'delay' more.
2019-11-01 16:12:39 +01:00
Zdenek Kabelac
010062cf03 tests: conversion only of exclusive lv
We can 'cache' only exclusively active LV in cluster.
2019-11-01 15:59:17 +01:00
Zdenek Kabelac
df00a62fd0 tests: avoid checking command result in cluster
When running cluster test with clvmd, the actual 'monitoring'
happens in cluster - so the 'already monitored' message
is also logged within clvmd code and the command cannot
see such effect.

clvmd was incapable to report this information back to command
so it cannot be displayed this way.

Add 'lvs -o+seg_monitor' validation which also works in clustered mode.
2019-11-01 15:56:03 +01:00
Zdenek Kabelac
796efef15e WHATS_NEW: update 2019-10-31 13:16:58 +01:00
Zdenek Kabelac
50ab7b3ceb tests: reduce space requirements
Test well runs on smaller test machines.
2019-10-31 13:14:50 +01:00
Zdenek Kabelac
719ab4da05 raid: drop internal error
Fix some internal error reports and debug trace returns
2019-10-31 13:00:01 +01:00
Zdenek Kabelac
2c46c60155 manip: optimize lvs_using_lv
Instead of checking all LVs in a VG - do just a direct copy of LVs
from the existing list ->segs_using_thin_lv.

TODO: maybe it could be better to expose seg_list to /tools...
2019-10-31 13:00:01 +01:00
Zdenek Kabelac
4b7bcf3ed4 mirror: remove unused code 2019-10-31 13:00:01 +01:00