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

16065 Commits

Author SHA1 Message Date
Marian Csontos
7ea50a47d1 build: make generate 2020-05-19 11:38:23 +02:00
Zdenek Kabelac
bac7d5951d WHATS_NEWS: update 2020-04-08 15:36:01 +02:00
Zdenek Kabelac
70d2ff38c0 test: repair of thin-pool used by foreign apps 2020-04-08 15:31:17 +02:00
Zdenek Kabelac
1316cafbe9 lvconvert: no validation for thin-pools not used by lvm2
lvm2 supports thin-pool to be later used by other tools doing
virtual volumes themself (i.e. docker) - in this case we
shall not validate transaction Id - is this is used by
other tools and lvm2 keeps value 0 - so the transationId
validation need to be skipped in this case.
2020-04-08 15:31:17 +02:00
Zdenek Kabelac
5f766b32cf container_of: use offsetof from stddef
Use standardized offsetof() macro from stddef.
Helps to build valid code with latest gcc10 with -O2.
2020-04-08 15:22:54 +02:00
Zdenek Kabelac
5d93892d4a dmeventd: enhance time waiting loop
dmeventd is 'scanning' statuses in loop (most usually in 10sec
intervals) - and meanwhile it sleeps within:
pthread_cond_timedwait()

However this function call tends to wakeup sometimes a short amount of
time sooner - and our code still believe the 'right time' has not yet
arrived and basically for a moment 'busy-looped' on calling this
function - so for systems with 'clock_gettime()' present we obtain
time and we go 10ms to the future second - this avoids unneeded
repeated invocation of our time scheduling loop.

TODO: monitoring during 1 hour 'time-change'...
2020-04-08 15:22:54 +02:00
Zdenek Kabelac
8f3d2d5e11 libdm: fix dm_list pointer arithmentic for new gcc 10 optimization 2020-04-08 15:22:54 +02:00
Marian Csontos
2e3791b421 post-release 2020-03-24 19:22:53 +01:00
Marian Csontos
84c239c4e5 pre-release 2020-03-24 19:21:50 +01:00
David Teigland
20d61a2553 pvs: fix locking_type 4
Fix for commit 79c4971210.
This bug leads lvm to attempt a bogus recovery of the
orphan VG whenever the orphan VG is read.
No recovery code exists for the orphan VG, but lvm still
attempts it when the "consistent" variable is not set to 1.

When lvm attempts the bogus/no-op orphan recovery, it tries
to get a write lock.  Usually the write lock succeeds, and
"recovery" does nothing, so fairly harmless.  But, with
locking_type=4, the write lock fails, which bubbles up to
cause the whole command failure.
2020-03-06 09:06:10 -06:00
Marian Csontos
deaf304ee6 bcache: Fix memory leak in error path 2020-03-04 13:22:10 +01:00
David Teigland
44c460954b Fix rounding writes up to sector size
Do this at two levels, although one would be enough to
fix the problem seen recently:

- Ignore any reported sector size other than 512 of 4096.
  If either sector size (physical or logical) is reported
  as 512, then use 512.  If neither are reported as 512,
  and one or the other is reported as 4096, then use 4096.
  If neither is reported as either 512 or 4096, then use 512.

- When rounding up a limited write in bcache to be a multiple
  of the sector size, check that the resulting write size is
  not larger than the bcache block itself.  (This shouldn't
  happen if the sector size is 512 or 4096.)

(cherry picked from commit 7550665ba4)

Conflicts:
	lib/device/dev-io.c
2020-03-04 13:20:36 +01:00
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