1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

16063 Commits

Author SHA1 Message Date
Marian Csontos
cde814abc0 pre-release 2021-05-07 17:33:50 +02:00
Zdenek Kabelac
844a075c01 cmdline: add missing comma in definition 2021-02-24 11:56:12 +01:00
Zdenek Kabelac
85795593b8 tests: make test complaint to local dev dir
For test running in 'local' dev dir we want to see loop devices there.
Also add missing notification to lvmetad after wipefs.
2021-02-24 11:56:12 +01:00
Zdenek Kabelac
f3babcb591 lvconvert: improve support for metadata profiles
lvconvert can use thin-profile just like lvcreate.
(Added already upstream as part of VDO support).
2021-02-23 23:30:46 +01:00
Zdenek Kabelac
e2b693fbe6 tests: update setting LVM_BINARY for testing
When testing is running on uninstealled system - prefer our own binary
in tests.
2021-02-23 16:29:48 +01:00
Zdenek Kabelac
1f220e8d43 WHATS_NEW: update 2021-02-23 15:03:03 +01:00
Zdenek Kabelac
0ab7fce2b3 tests: remove local setting of LVM_BINARY
To better test actually fsadm in test suite - avoid setting
LVM_BINARY locally - since test setup already modifies
PATH to find test's lvm binary as the 1st. in path.
2021-02-23 15:01:53 +01:00
Zdenek Kabelac
c94657cc2e fsadm: avoid access to unbound variable 2021-02-23 15:01:53 +01:00
Zdenek Kabelac
87e0b1a36f WHATS_NEW: updates 2021-02-17 12:59:36 +01:00
Zdenek Kabelac
99d8b91422 make: generate 2021-02-17 12:59:36 +01:00
Zdenek Kabelac
37a97c8995 makefiles: ignore missing files 2021-02-17 12:59:36 +01:00
Zdenek Kabelac
dee104668e snapshot: create origin of virtual snap read only
When creating old fashioned way thick virtual snapshot,
use read-only 'zero' _vorigin device.
2021-02-17 12:14:54 +01:00
Zdenek Kabelac
02978e1f01 lvchange: snapshot thick origin permission rw/r
User is allowed to change permission for thick origin.
FIXME: it's not quite clear why few others are prohibited to change.
2021-02-17 12:14:54 +01:00
Zdenek Kabelac
7bb472bc30 lvconvert: read-only origin cannot be merged
When user sets snapshost origin as read-only,
lvm will not allow simple merge and user needs to
flip permission,
2021-02-17 12:14:54 +01:00
Zdenek Kabelac
86cd2c6309 tests: avoid killing test machines with kernel bug
Bug 1916891  still applies:

https://bugzilla.redhat.com/show_bug.cgi?id=1916891
2021-02-17 12:09:16 +01:00
Zdenek Kabelac
8bc7bb2dbf tests: check for raid target support 2021-02-17 12:09:16 +01:00
Zdenek Kabelac
a157c9e1a1 libdm: simplify line emitter checking 2021-02-17 12:09:16 +01:00
Zdenek Kabelac
0914ce76bd tests: readonly snapshot thick origin can't be merged
When user sets snapshot thick origin as read-only - lvconvert --merge refuses
to merge until user swiches origin to 'read-write'.
2021-02-17 11:56:26 +01:00
Zdenek Kabelac
b6dda4ade2 lvchange: remove unneeded call
Sync is already happining in activate_and_wipe_lvlist().
2021-02-17 11:56:13 +01:00
Zdenek Kabelac
5acbd709c1 lv_manip: avoid removing LV when converting
In some cases we use 'creation' also during conversion.
Here it can be actually unwanted side effect we may remove
not just newly created layers - but also original converted LV.

So until we make clear how to properly revert from some errors
in middle of conversion, disable removal for any 'lvconvert' commands.
2021-02-17 11:56:13 +01:00
Zdenek Kabelac
1f6c287aac tests: lvdisplay does not crash for merged thin 2021-02-17 11:56:13 +01:00
Zdenek Kabelac
7243e32ce5 lvdisplay: fix show of merged thin snapshot
When lvdisplay was executed and thin snaphost has be merged to
thin origin and the operation has been postponed till devices
are closed, command crashed.

Check LV is COW before trying to check snapshot percentage.
2021-02-17 11:56:12 +01:00
Zdenek Kabelac
9344a04b37 tests: lvconvert thin profile conversion 2021-02-17 11:56:12 +01:00
Zdenek Kabelac
7b51f39c84 lvconvert: thin errorwhenfull and recalculation
When converting an existing LV to thin-pool,
user may now pass also '--errorwhenfull' option
like with 'lvcreate'.

Also recalculate chunksize when performace profile is
used with conversion (again matching lvcreate).

Adds missing flagging for uncropped metadata sizes.
2021-02-17 11:56:12 +01:00
Zdenek Kabelac
6a1e8104f8 targets: use target_present_version
Skip duplicated  dm version   ioctl() on every startup.
2021-02-09 15:04:18 +01:00
Zdenek Kabelac
0f074a4d65 tests: support for resized cached LVs
Support for cached LVs is now enabled.
2021-02-09 15:04:18 +01:00
Zdenek Kabelac
4eeb9e7663 lv_resize: support resizing of cached volumes
Automatically figure out resizable layer in the LV stack and
resize it online.

Split check for reshaped raids and postpone removal of
unused space after finished reshaping after metadata archiving.

Drop warning about unsupported automatic resize of monitored thin-pool.

Currently there is not yet support for resize of writecache.
2021-02-09 15:04:18 +01:00
Zdenek Kabelac
d3a9bf4a56 lv_manip: reuse function also during reduction
Move function _setup_lv_size() in front of _lv_reduce() so
it can be reused also in this function.
Avoid propagating 0 length to upper layer.
2021-02-09 14:56:10 +01:00
Zdenek Kabelac
619ad644cc lv_resize: use 'bad' code path for error case 2021-02-09 14:45:29 +01:00
Zdenek Kabelac
6c99725261 thin: check for overprovisioning only once 2021-02-09 14:45:29 +01:00
Zdenek Kabelac
cfb9bf13c7 thinpool: use lv_config_profil for crop_metadata
Better support for thin-pools with individual profiles introduced
in the recent patch b4212be2e7.
2021-02-09 14:45:29 +01:00
Zdenek Kabelac
18677e24c1 aux: update thin_restore_needs_more_volumes
Version 0.8.5-2.el7 needs to return 0;
2021-02-01 14:35:53 +01:00
Zdenek Kabelac
99bdbc53ba tests: update thin and cache checked messages
Slightly changed messages for allocation of pool metadata.
2021-02-01 14:35:53 +01:00
Zdenek Kabelac
f6025cdc73 tests: check 16G thin pool metadata size 2021-02-01 14:35:53 +01:00
Zdenek Kabelac
1728f41183 WHATS_NEW: updates 2021-02-01 14:35:53 +01:00
Zdenek Kabelac
1282e9e298 allocation: report allocation error instead of crash
Current allocation limitation requires to fit metadata/log LV on
a single PV. This is usually not a big problem, but since
thin-pool and cache-pool is using this for allocating extents
for their metadata LVs it might be eventually causing errors
where the remaining free spaces for large metadata size is spread
over several PV.
2021-02-01 14:35:53 +01:00
Zdenek Kabelac
862a86982c pvmove: automatically resolve whole stacked LV
When passing 'pvmove --name arg' try to automatically move
all associated dependencies with given LV.

i.e. 'pvmove --name thinpool vg vgnew'
moves all thins and data and metadata LV into a new VG vgnew.
2021-02-01 14:35:53 +01:00
Zdenek Kabelac
dd2501d64b cache: reuse code for metadata min_max
Use update_pool_metadata_min_max() which is shared with
thin-pool metadata min-max updating.

Gives improved messages when converting volumes to metadata.
2021-02-01 14:35:53 +01:00
Zdenek Kabelac
72b12033a9 pool: limit pmspare to 16GiB
There is not much point to let allocate more then this size
even when i.e. converted LV is bigger then 16GiB (%extent_size)
ATM neither thin-pool nor cache-pool supports bigger metadata.
2021-02-01 14:35:53 +01:00
Zdenek Kabelac
586bac0b10 thin: improve 16g support for thin pool metadata
Initial support for thin-pool used slightly smaller max size 15.81GiB
for thin-pool metadata. However the real limit later settled at 15.88GiB
(difference is ~64MiB - 16448 4K blocks).

lvm2 could not simply increase the size as it has been using hard cropping
of the loaded metadata device to avoid warnings printing warning of kernel
when the size was bigger (i.e. due to bigger extent_size).

This patch adds the new lvm.conf configurable setting:
allocation/thin_pool_crop_metadata
which defaults to 0 -> no crop of metadata beyond 15.81GiB.
Only user with these sizes of metadata will be affected.

Without cropping lvm2 now limits metadata allocation size to 15.88GiB.
Any space beyond is currently not used by thin-pool target.
Even if i.e. bigger LV is used for metadata via lvconvert,
or allocated bigger because of to large extent size.

With cropping enabled (=1) lvm2 preserves the old limitation
15.81GiB and should allow to work in the evironement with
older lvm2 tools (i.e. older distribution).

Thin-pool metadata with size bigger then 15.81G is now using CROP_METADATA
flag within lvm2 metadata, so older lvm2 recognizes an
incompatible thin-pool and cannot activate such pool!

Users should use uncropped version as it is not suffering
from various issues between thin_repair results and allocated
metadata LV as thin_repair limit is 15.88GiB
Users should use cropping only when really needed!

Patch also better handles resize of thin-pool metadata and prevents resize
beoyond usable size 15.88GiB. Resize beyond 15.81GiB automatically
switches pool to no-crop version. Even with existing bigger thin-pool
metadata command 'lvextend -l+1 vg/pool_tmeta' does the change.

Patch gives better controls 'coverted' metadata LV and
reports less confusing message during conversion.

Patch set also moves the code for updating min/max into pool_manip.c
for better sharing with cache_pool code.
2021-02-01 14:35:53 +01:00
Zdenek Kabelac
5196392bcd libdm: add dm_tree_node_add_thin_pool_target_v1
Supports thin-pool without crop.
2021-02-01 14:32:07 +01:00
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