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

16063 Commits

Author SHA1 Message Date
Zdenek Kabelac
50ac89448f fsadm: fix bash artihmetic
These shell vars needs to be without "".
2020-10-25 21:45:49 +01:00
Zdenek Kabelac
a12574303d tests: minor update 2020-10-25 20:23:41 +01:00
Zdenek Kabelac
4dcb35cb03 fsadm: better check for getsize64 support
Older blockdev tool return failure error code with --help,
and since now the tool abort on command failure, lets
detect missing --getsize64 support directly by running
command and check if it returns something usable.

It's likely very hard to have the system with
such old blockdev tool and newer lvm2 compiled.
2020-10-25 20:19:31 +01:00
Zdenek Kabelac
66ea26131b make: remove file from master
To ensure lcov creation is not trying to pick wrong files
when using same machine for building stable-2.02 and master branch,
ensure the new files are being deleted even in stable-2.02
branch for  'make clean & make distclean' targets
2020-10-25 17:36:04 +01:00
Zdenek Kabelac
bb5f81624b cov: dmeventd plugin fix memleak
Fix memory leak when policy command fails too frequently and
plugin decided to skip it.
2020-10-25 00:56:11 +02:00
Zdenek Kabelac
f5a2607bb1 WHATS_NEW: update 2020-10-24 01:37:10 +02:00
Zdenek Kabelac
67dc22b95e tests: fsadm test continue after fs repair
Test case where filesystem has been corrected via fsck.
In such case fsck returns '1' as success and should be
handled in a same way as '0' since fs is correct.
2020-10-24 01:33:39 +02:00
Zdenek Kabelac
9a2a59c0ed fsadm: enhance error handling
Set more secure bash failure mode for pipilines.
Avoid using unset variables.
Enhnace error reporting for failing command.
Avoid using error via 'case..esac || error'.
2020-10-24 01:33:39 +02:00
Zdenek Kabelac
ab99382d7a fsadm: handle fsck return 1 for corrected fs 2020-10-24 01:33:39 +02:00
Zdenek Kabelac
ee2c80133c fsadm: use NULL
Use consistently $NULL as in other places.
2020-10-24 01:33:39 +02:00
Zdenek Kabelac
e478ef2f59 filters: persistent filter hides rename failure
Filters are saved on command's exit path - and as such they are
not protected by any locks.
This means 2 running commands may 'race' here and 2nd. command
may have already renamed filename for the 1st. command.
So if the rename fails here - we will only use log_sys_debug,
as the failure doesn't cause command failure result.
2020-10-24 01:31:40 +02:00
Zdenek Kabelac
f33ccaee45 tests: changes from master 2020-10-20 23:23:44 +02:00
Zdenek Kabelac
e8cd4e2057 WHATS_NEW: update 2020-10-20 22:52:21 +02:00
Zdenek Kabelac
df9eba8263 tests: check dmevent with bigger reserved_stack
Check dmeventd remains working when reserved_stack
is above 300KiB.
2020-10-20 22:50:05 +02:00
Zdenek Kabelac
9690193ce0 memlock: allocate at most halve of rlimit stack
Touch of stack allocation validated given size with rlimit
and if the reserved_stack was above rlimit, its been completely
ignored - now we will always touch stack upto rlimit/2 size.
2020-10-20 22:49:55 +02:00
Zdenek Kabelac
511cd6adb7 lvmcmdlib: lvm2_init_threaded
cmd context has 'threaded' value that used be set
by clvmd - and allowed proper memory locking management.
Reuse same bit for dmeventd.

Since dmeventd is using 300KiB stack per thread,
we will ignore any user settings for allocation/reserved_stack
until some better solution is find.
This avoids crashing of dmevend when user changes this value
and because in most cases lvm2 should work ok with 64K stack
size, this change should not cause any problems.
2020-10-20 22:49:18 +02:00
Zdenek Kabelac
f0913c6482 debug: shorten error message
Just check for sigint during log_error().
2020-10-20 22:48:02 +02:00
Zdenek Kabelac
b9d2aa9488 man: regenerate 2020-10-20 22:41:34 +02:00
Zdenek Kabelac
50621533dd man: more precise UNIT
Since 'kilobytes' could be seen in 2 way - SI as '1000',
while all programmers sees it as '1024' - switch to
commonly acceptted  KiB, MiB....

Resolves RHBZ 1496255.
2020-10-20 22:41:34 +02:00
Zdenek Kabelac
8af590b1bb lv_manip: add space into message 2020-10-20 22:41:34 +02:00
Peter Rajnoha
aa4f1f117a blkdeactivate: add missing VDO_AVAILABLE check in deactivate_vdo
(cherry picked from commit 8806f2d5ed)
2020-10-19 16:02:20 +02:00
Peter Rajnoha
2c048bd77d blkdeactivate: add support for VDO in blkdeactivate script
Make it possible to tear down VDO volumes with blkdeactivate if VDO is
part of a device stack (and if VDO binary is installed). Also, support
optional -o|--vdooptions configfile=file.

(cherry picked from commit 0dd905c959)

Conflicts:
	WHATS_NEW_DM
2020-10-19 16:02:20 +02:00
Zdenek Kabelac
e5af7bef22 tests: extend area covered by error target
Since 'BLKZEROOUT' streams out more block at once, at can easily
zero-out larger set of blocks after 1st. failing one.

So the test is adapted to fully 'hide' swap header under error target.
2020-10-18 21:28:13 +02:00
Zdenek Kabelac
5ad30c57b3 debug: update messages 2020-10-18 21:28:13 +02:00
Zdenek Kabelac
b8454b59e1 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.
2020-10-18 21:28:13 +02:00
Zdenek Kabelac
ac5cf1544e configure: check for BLKZEROOUT support 2020-10-18 21:28:13 +02:00
Zdenek Kabelac
e9241860a8 wipe_lv: interruptible wiping
Since we now block signals and wiping may take unexpectedly long
time - support breaking command while wipe is in progress.
2020-10-18 21:28:13 +02:00
David Teigland
e94e0cd020 label: cleanup set_byte error exit 2020-10-18 21:28:13 +02:00
Zdenek Kabelac
35104f7ba5 wipe: dev_set_bytes resolves zeroing
Since dev_write_zeros() is just subset of dev_set_bytes()
use it directly and simplify code.
2020-10-18 21:28:13 +02:00
Zdenek Kabelac
0559ce6be0 configure: fix python paths
Stable branch supports also python2.
2020-10-18 21:28:13 +02:00
Zdenek Kabelac
789fc2a081 configure: editline updates
Update configure file.
2020-10-18 21:28:13 +02:00
Bastian Germann
f0a2b6737a 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
2020-10-18 21:28:13 +02:00
Zdenek Kabelac
cc5eb1d70f tests: check pool metadata are zeroed 2020-10-18 21:28:13 +02:00
Zdenek Kabelac
a46fdf5426 tests: failure of zeroing fails command 2020-10-18 21:28:13 +02:00
Zdenek Kabelac
e5010662a1 lvconvert: more support for yes conversion
When converting volume to pool LV use also wiping of other signatures.
For pool conversion support --yet and --force
to bypass prompting for signature wiping.

Note: currently we have lvconvert doing convertion and prompting
for confirmation of conversion - and then again wipe_lv() prompts
for removing i.e. filesystem signature - we should unify this
prompting into 1 message  - althought the 'filesystem' discovery
needs active volume - while the 1st. conversion prompt can
work without active converted volume.
2020-10-18 21:27:51 +02:00
Zdenek Kabelac
9c746f153e wipe_lv: always zero at least 4K
When zero_sectors passed value like 1 - we could zero only 1 sector.
Reinstantiate we always zero at least 4K block.
2020-10-18 21:27:51 +02:00
Zdenek Kabelac
8ee2479dd0 pool: zero metadata
To avoid polution of metadata with some 'garbage' content or eventualy
some leak of stale data in case user want to upload metadata somewhere,
ensure upon allocation the metadata device is fully zeroed.

Behaviour may slow down allocation of thin-pool or cache-pool a bit
so the old behaviour can be restored with lvm.conf setting:
allocation/zero_metadata=0

TODO: add zeroing for extension of metadata volume.
2020-10-18 21:27:51 +02:00
Zdenek Kabelac
7a06bc2400 wipe_lv: make error a fatal event
Failure in wiping/zeroing stop the command.
If user wants to avoid command abortion he should use -Zn or -Wn
to avoid wiping.

Note: there is no easy way to distinguish which kind of failure has
happend - so it's safe to not proceed any futher.
2020-10-18 21:27:51 +02:00
Zdenek Kabelac
84f03e2b63 gcc: calc size in compile time 2020-10-18 21:27:51 +02:00
Zdenek Kabelac
0c8f160fb2 label: deduplicate dev_set_bytes
As dev_write_zeros() is same as dev_set_bytes() reused the code
directly.
2020-10-18 21:27:51 +02:00
Zdenek Kabelac
1998825e12 label: code deduplication 2020-10-18 21:27:51 +02:00
Zdenek Kabelac
ba7740df50 label: use open_rw
Add missing declaration for label_scan_open_rw()
which has been already introduced without declaration
and use it for wiping LV.
2020-10-18 21:26:38 +02:00
Zdenek Kabelac
8792d417f3 libdm: validate thin-pool before sending messages
Alhtough lvm2 does validation on its side, ensure DM code
is not sending messages to failed thin pool.
2020-10-18 00:28:17 +02:00
Zdenek Kabelac
afffab0921 libdm: enhance error message 2020-10-18 00:28:17 +02:00
Zdenek Kabelac
d143ee13c7 libdm: split code for sending message
Move message sending from _thin_pool_node_message to
new _node_message for possible better code sharing.
2020-10-18 00:28:17 +02:00
Zdenek Kabelac
ba69c433c1 wipe: convert zero_value to uint8_t
We always write this value as byte.
2020-10-16 23:14:45 +02:00
Zdenek Kabelac
9bddffd7ad WHATS_NEWS: update 2020-10-16 23:14:12 +02:00
Zdenek Kabelac
ef5cddc208 dm: remove created devices on error path
DM tree keeps track of created device while preloading a device tree.
When fail occures during such preload, it will now try to remove
all created and preloaded device. This makes it easier to maintain
stacking of device, since we do not need to check in-depth for
existance of all possible created devices during the failure.
2020-10-16 21:10:04 +02:00
Zdenek Kabelac
7c262bfc85 rpm: bare words are no longer supported
Update for new rpm requirement and use "..." words.
2020-10-16 18:09:55 +02:00
Zdenek Kabelac
7d3e7266c7 tests: missed char in list
'=' also doesn't belong to property name.
2020-10-16 18:09:55 +02:00