1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

4222 Commits

Author SHA1 Message Date
Zdenek Kabelac
0b6ee6a912 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 12:54:45 +01:00
Marian Csontos
6308365d48 post-release 2021-01-08 10:08:36 +01:00
Marian Csontos
3e8bd8d1bd pre-release 2021-01-08 10:07:25 +01:00
Zdenek Kabelac
2183af62e5 WHATS_NEW: update 2020-10-24 01:42:16 +02:00
Zdenek Kabelac
e7fff97b8d 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-02 21:04:16 +02:00
Zdenek Kabelac
c65d3a6b8a 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-02 21:03:19 +02:00
Zdenek Kabelac
7396f1cfee wipe_lv: drop label_scan_invalidate on error path
Since dev_set_bytes() now closes  dev on error path itself,
remove this unneeded call now (introduced few commits back
in history thus removing comment from WHATS_NEW)
2020-10-02 21:02:04 +02:00
Zdenek Kabelac
b3c7a2b3f0 bcache: support interrupts when waiting on IO
Since lvm2 normally block signals during protected
phase where it does not want to be interrupted.
Support interruptible processing when allowed
in section between sigint_allow() ... sigint_restore())
and let the 'io_getenvents()'  finish with EINTR.
2020-10-02 20:57:50 +02:00
Zdenek Kabelac
0fe58fc54f bcache: fix busy loop with too many errors
When bcache tries to write data to a faulty device,
it may get out of caching blocks and then just busy-loops
on a CPU - so this check protects this by checking
if there is already max_io (~64) errored blocks.
2020-10-02 20:56:55 +02:00
Zdenek Kabelac
41f9e372c0 bcache: fix waiting problem for completed IO
Call _wait_all() which does check whether there is still
some pending IO before sleep. Otherwise it may happen
our submitted IO operations have been already dispatched
and this call then endlessly waits for IO which are all done.
This can be reproduced when device returns quickly errors
on write requests.
2020-10-02 20:53:41 +02:00
Zdenek Kabelac
9885c9b43a configure: use our ordered list of python names
Since it seems it's prefered now to use python3 in path name,
prefer this name as first in the list.
2020-10-02 20:52:38 +02:00
Zdenek Kabelac
655342427d configure: editline updates
Update configure file.
2020-09-29 10:43:45 +02:00
Zdenek Kabelac
ef59c83f2d thin: enhance lvcreate error paths
Improve error response and reporting, when creating thin snapshots.
If the thin pool kernel metadata already have device with ID lvm2
tries to create, give more meanigful error message and also properly
restore transaction id to the value known to thin-pool in this case.

Before it's been possible to divert by one from kernel TID value,
and lvm2 stacked delete message for such thin device.
2020-09-25 22:56:40 +02:00
Zdenek Kabelac
fc9e732811 vgsplit: support for VDO volumes
Enable support and ensure VDO always moves with VDOPOOL.
2020-09-25 22:51:50 +02:00
Zdenek Kabelac
3a3307c0d8 vdo: enhance vdo pool extension
When user tries to extend vdo pool - he needs to go always
at least by 1 full VDO slab  (defined as  vdo_slab_size_mb).

To avoid all trouble around find 'workable' size - lvm2 automatically
increases the passed (or by --use-policies calculated) extension size
(and informs a user about sometimes possibly large increase as slab
size can go upto 32GiB)

With VDO users need to always 'think-big' anyway and expect such
operation to be in GiB domain range.
2020-09-22 23:28:43 +02:00
Zdenek Kabelac
5bc66532c7 activation: use revert_lv on tree suspend failure
When thetable reload fails during suspend() - we were only calling
plain resume() - and this will reload only those devices,
which were left suspend, but will not try to restore
metadata state according to lvm2 reverted metadata.
So if we were reloading device tree - we have restored
only top-level LV and rest of reverted device manipulation
were left alone and possibly mismatched what is in committed
metadata.

FIXME: There are several cases were such revert will likely not work
properly anyway as some operation are currenly handled in single commit,
while they need multiple commits, but it's step towards better correctness.
At least we catch there errors now earlier.
2020-09-22 21:02:14 +02:00
David Teigland
72b931d664 configure: enable integrity by default 2020-09-16 15:14:51 -05:00
Zdenek Kabelac
2101e324f9 locking: restore blocking signal for VG_GLOBAL lck
During removal of a lot of locking code the signal blocking got lost
and signal processing got broken leading to unpredictable
behavior of i.e. activation code the can get interrupted in the
middle of DM table processing.

lvm2 code always expects signals are blocked while lock is held
unless it is explictelly placed into section of:
sigint_allow();....;sigint_restore();
For checking catched interrupt there is sigint_catched();
2020-09-14 00:15:14 +02:00
Zdenek Kabelac
77fdc17d70 alloc: improve estimation of sufficient_pes_free
Metadata size was calculated correctly only for raids.

Fixes problem for crash during lvcreate when thin-pool was created
on a VG where remaining free space had the size to only fit a single
metadata LV and not also its _pmspare.

Lvcreate crashed with this assert message:

lvcreate: metadata/pv_map.c:198: consume_pv_area: Assertion `to_go <= pva->count' failed.
Aborted (core dumped)

TODO: there is probably to large overload of several alloc_handle
variables.

Reported-by: Wu Guanghao<wuguanghao3@huawei.com>
Reported-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2020-09-11 21:51:24 +02:00
Zdenek Kabelac
9f78acfee9 thin: compensate metadata size by extra percent
When using --use-policy for automatic extension of thin-pool,
the extension of thin-pool's metadata itself can actually take
some extra space.
Since I'm not aware of exact compensation formula, add just
1% extra to calculated amount and hope it fits.

Wanted target is to always have usable thin-pool that fits
bellow pool_metadata_min_threshold().
2020-09-11 21:42:37 +02:00
Zdenek Kabelac
e7f5acdfa6 lvextend: improve percentage estimation
Correcting rounding rules for percentage evaluation.

Validate supported range of percentage.
(although ranges are already validated earlier on code path)
2020-09-10 23:54:31 +02:00
Zdenek Kabelac
6d392776b0 configure: compile with vdo and writecache by default
Enable compilation of vdo and writecache support as internaly
supported segment types by default.

For disabling use:

--with-vdo=none
--with-writcache=none
2020-09-10 23:54:10 +02:00
Zdenek Kabelac
0210c7076d man: correcting vdo issues
Fixing reported bugs within provided examples - so examples
can be used via cut&paste.
2020-09-09 15:16:34 +02:00
Zdenek Kabelac
af33a00847 Revert "raid: add _rimage and _rmeta as origin_only"
This reverts commit 3388e19489.
More thinking needed.
2020-09-09 00:58:52 +02:00
Zdenek Kabelac
a8ea1817ab Revert "raid: do not enforce flushing of raids when it is not required"
This reverts commit ce5ea07411.
More thinking needed.
2020-09-09 00:58:32 +02:00
Zdenek Kabelac
ce5ea07411 raid: do not enforce flushing of raids when it is not required
This is probably somewhat experimantal patch - but when i.e. raid device
is just extend, there should not be a technical need for flush,
unless the target would stricly need it.  It should allow faster
processing of lvm command not being blocked by possibly longer flush.
2020-09-08 21:23:03 +02:00
Zdenek Kabelac
3388e19489 raid: add _rimage and _rmeta as origin_only
Since we do not support rimage & rmeta for snapshots - we can
avoid quering for -cow devices and add them as origin_only -
since their snapshots (-cow) could have never existed.
This redumes several ioctl operation during table preloading.
2020-09-08 21:23:03 +02:00
Zdenek Kabelac
fd96f1014b gcc: zero-sized array to fexlible array C99
Switch remaining zero sized struct to flexible arrays to be C99
complient.

These simple rules should apply:

- The incomplete array type must be the last element within the structure.
- There cannot be an array of structures that contain a flexible array member.
- Structures that contain a flexible array member cannot be used as a member of another structure.
- The structure must contain at least one named member in addition to the flexible array member.

Although some of the code pieces should be still improved.
2020-09-01 17:57:50 +02:00
Zdenek Kabelac
ef389603dd cachevol: correcting 64b math
Widen to 64bit for correct 64b multiplication math.
2020-09-01 17:50:48 +02:00
Zdenek Kabelac
f0614e7cf0 WHATS_NEW: update 2020-08-28 21:43:03 +02:00
Zdenek Kabelac
46d15b5e4d wipe_lv: close devices on error path
Device was kept open preventing its deactivated and removed
on error path.
2020-08-19 15:09:09 +02:00
Zdenek Kabelac
3e9664baca man: vdo improvals
Add some more notes about discard.
Correct enumeration.
2020-08-19 15:09:09 +02:00
Marian Csontos
231cdd0efb post-release 2020-08-09 16:17:15 +02:00
Marian Csontos
4d9f0606be pre-release 2020-08-09 16:17:15 +02:00
Marian Csontos
c1d136fea3 WHATS_NEW 2020-08-09 16:17:15 +02:00
Tony Asleson
4f44841045 WHATS_NEW: Add writecache lvmdbusd 2020-08-06 15:42:49 -05:00
Heinz Mauelshagen
8f421bdd7a lvconvert: preset raid1 in case of striped conversions
Fixed invoking "lvconvert -m+1 $StripedLV" to cause errors
(preset raid conversion implied by '-m').

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1781406
2020-07-13 19:07:26 +02:00
Heinz Mauelshagen
286a793c12 lvconvert: fix conversion to 'mirrored' mirror log with larger regionsize
merge.c:_check_lv_segment() was checking regionsize vs. mirrored LV size on
any 'mirror/raid1/raid10' segment type including type 'mirrored' mirror logs.

Avoid the check only for 'mirrored' mirror logs to allow conversion from log
type 'disk' with regionsize > mirror log SubLV size.

As we disabled support for 'mirrored' mirror logs with
commit e82303fd6a which still conditionally
allows to enable it via global/support_mirrored_mirror_logs=1,
patch is mandatory for all distributions.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1712983
2020-07-09 14:39:50 +02:00
Zdenek Kabelac
bc39d5bec6 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-06-24 15:01:03 +02:00
Zdenek Kabelac
edbc5a62b2 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-06-24 15:01:03 +02:00
Zdenek Kabelac
6eb9eba59b bcache: support longer writes
When initiated larger write request, it may have happened, bcache
got out of free chunks - fix the loop, that is supposed to wait
until next free chunk becomes avain available.
2020-06-24 15:01:03 +02:00
David Teigland
211eaa284c WHATS_NEW: integrity with raid 2020-04-15 12:10:39 -05:00
Zdenek Kabelac
e10f20bc23 WHATS_NEWS: update 2020-04-08 15:37:24 +02:00
Marian Csontos
06cbe3cfc6 post-release 2020-03-26 12:22:09 +01:00
Marian Csontos
e1c2b41265 pre-release 2020-03-26 12:21:16 +01:00
Zdenek Kabelac
9532bb577a tests: validate vdo slab_size
New vdoformat can print this size - so check we pass proper bit count
matching preset value.
2020-02-26 13:29:21 +01:00
Zdenek Kabelac
892a182975 cachevol: stop dm errors with uncaching cache with cachevol
Fix the anoying kernel message reported:
device-mapper: cache: 253:2: metadata operation 'dm_cache_commit' failed: error = -5
which has been reported while cachevol has been removed.
Happened via confusing variable - so switch the variable to commonly user '_size'
which presents a value in sector units and avoid 'scaling' this as extent length
by vg extent size when placing 'error' target on removal path.

Patch shouldn't have impact on actual users data, since at this moment
of removal all date should have been already flushed to origin device.

m
2020-02-11 17:19:57 +01:00
Marian Csontos
25b97e522d post-release 2020-02-11 10:53:01 +01:00
Marian Csontos
b9752d719c pre-release 2020-02-11 10:51:57 +01:00
Zdenek Kabelac
9255c7148a WHATS_NEW: update 2020-02-04 17:22:06 +01:00