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

16022 Commits

Author SHA1 Message Date
Zdenek Kabelac
5e97bc5e67 man: update lvmthin
Add few more notes about thin-pool repair.
Fix couple typos.
2021-02-01 13:43:13 +01:00
Heinz Mauelshagen
c56b3fa4e2 lvdisplay: enhance LV status output for raid(0)
In case legs of a raid0 LV are removed, the lvdisplay command still
reports 'available' though raid0 is not providing any resilience
compared to the other raid levels.

Also lvdisplay does not display '(partial)' in case of missing raid0
legs as oposed to the lvs command.

Enhance lvdisplay to report "NOT available" for any RaidLV type in case
too many legs are inaccessible hence causing data loss.  I.e. any leg
for raid0, all for raid1, more than 1 for raid4/5, more than 2 for raid6
and in case of completely lost mirror groups for raid10.

Add test/shell/lvdisplay-raid.sh.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1872678
2021-01-27 16:59:02 +01:00
Zdenek Kabelac
1d94748601 tests: check full zeroing of thin-pool metadata
Check zeroing works on whole thin-pool metadata device.
2021-01-13 10:41:26 +01:00
Zdenek Kabelac
b9d31664dc tests: check thin-pool corner case allocs 2021-01-13 10:41:17 +01:00
Zdenek Kabelac
194630be52 alloc: enhance estimation of sufficient_pes_free
Since commit 77fdc17d70 always include
log_len size into needed extents - however now we may need sometimes
more extents then necessary - mainly when multiple PVs are involved
into allocation.

Add logs_still_needed into calculation of sufficient_pes_free()
2021-01-13 10:40:46 +01:00
David Teigland
b98c334635 vgextend: check missing device during block size check
Checking the block size when a device is missing could
trigger a segfault.
2021-01-05 10:19:01 -06:00
Zdenek Kabelac
92a67e3d3f tests: few more fsadm checks 2020-12-08 22:17:17 +01:00
Zdenek Kabelac
307acb072b fsadm: fix unbound variable usage
When 'fsadm resize vg/lv' is used without size, it should just
resize filesystem to match device - but since we now check
for unbound variable in bash - the previous usage no longer
works and needs explicit check.
2020-12-08 22:17:17 +01:00
Zdenek Kabelac
da7ec2ec0f gcc: cleanup warns from older gcc 2020-10-25 21:56:02 +01:00
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