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

17420 Commits

Author SHA1 Message Date
Zdenek Kabelac
d6bc11bf72 tests: use mirror throttling
With small mirrors its better to throttle speed of mirror in dm-mirror.
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
2dd43a7314 tests: slow down device more
Make the race with too fast merging less likely to occure.
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
94c4af232c tests: prohibit 4K brd device with integrity
Older kernels hit these errors:

device-mapper: integrity: Bio not aligned on 8 sectors: 0x8ffc, 0x4
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
179f59a0ca tests: add FIXME to raid test
We have here some kind of catch-22 - since older kernels do
use 'resync' while new 'recover' for initial raid synchronization.

So now - how do we recognize in which state of raid we are.
ATM seems to be simplest to simply keep disabled droping of primary raid
leg unless we are in sync.

FIXME: we should add a target version check and enable removal
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
05920e3818 raid: restore mirror handling in _raid_in_sync
Function is not having the best name since it does check
no just raid LVs to be in sync.

Restore the mirror percentage checking - although without retries,
since only raid target is currently known to need it - for other
types it would be ATM a bug to get inconsistent result.
2021-03-20 10:52:24 +01:00
Zdenek Kabelac
edcc410835 tests: fix condition for exclusion of /dev 2021-03-20 00:28:13 +01:00
Zdenek Kabelac
d5b37f24f4 tests: aux reject /dev as testing dir
If LVM_TEST_DIR would be set to /dev, reject such selection.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
e27baa791f tests: drop status workaround
lvconvert should now recognize resync from older kernels.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
ed90a3d9b4 tests: copy more data
Give pvmove --abort bigger aborting window.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
fe3ef6867f tests: require newer raid version
Tests needs reshape support - so require newer target version
as quick fix.

TODO: inspect indiviual supportable conversion with older versions.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
3d26bde1c0 make: cflow target works again
Restored 'make cflow' functinality.
Produces some quick referece of function chaining and usage.
2021-03-20 00:05:01 +01:00
Zdenek Kabelac
e86798203e make: simplify dependency loading
No need for extra ifdefs around.
2021-03-19 23:21:18 +01:00
Zdenek Kabelac
48d04afaa2 make: restore buildir != srcdir support
Our new faster deps generation missed support for
buildirs != srcdir - as it can be usable to have
several builds from unchanged directory with sources.
2021-03-19 23:21:18 +01:00
Zdenek Kabelac
c6a76c1ffe make: generate
Add new lvmdevices.8_pregen and vgimportdevices.8_pregen.
2021-03-19 23:21:18 +01:00
Zdenek Kabelac
81d3639955 git: update .gitignore
Hide some files from older builds.
2021-03-19 23:21:18 +01:00
Zdenek Kabelac
d3d28b1b64 cleanup: reduce code dupliction 2021-03-19 23:21:18 +01:00
Zdenek Kabelac
d37b19aaaa gcc: ensure buffer ends with 0 2021-03-19 23:21:18 +01:00
Zdenek Kabelac
79d8d06217 raid: move non dm functions from DEVMAPPER ifdef
When lvm is compiled without device-mapper - this functions
do not need this kernel support so move them from ifdef DEVMAPPER
sections.
2021-03-19 23:20:23 +01:00
Zdenek Kabelac
cc140f68a5 raid: resync cannot lose primary leg
Prohibity droping primary leg while resyncing.
2021-03-19 23:19:31 +01:00
Zdenek Kabelac
076e155697 raid: interruptible usleep when waiting for sync
Whiel waiting for raid to return consistent status,
use interruptible sleep - so command can break quickly.

Use lv_raid_status() to get percentage easily from status.
2021-03-19 23:17:03 +01:00
Zdenek Kabelac
b4ab2a1051 WHATS_NEW: updates 2021-03-18 19:12:35 +01:00
Zdenek Kabelac
26fb6b5e8d tests: check for raid sync in progress
TODO: this needs to be built-in in lvm command itself.
2021-03-18 19:12:00 +01:00
Zdenek Kabelac
accf324ccb tests: add check for lvconvert without zeroing
Check lvconvert -Zn does not zero thin-pool metadata.
Also check --type zero is usable for thin-pool data.
2021-03-18 18:57:45 +01:00
Zdenek Kabelac
c06325263f tests: check mixing striped with error and zero 2021-03-18 18:57:45 +01:00
Zdenek Kabelac
1880b573f3 tests: aux always shift emulated devices by 1MiB
Always shift created virtual PVs on backing device by 1MiB
and leave 1MiB free space at the end of device.

This way the system doesn't see same PV headers at multiple devices.
2021-03-18 18:57:45 +01:00
Zdenek Kabelac
8e7690b798 thinpool: support lvconvert without zeroing
Since lvm does support external users of thin-pool when thin devices
are managed outside it can be useful to support conversion to
thin pool from data and metadata LV without zeroing.
TransactionID will be 0 in lvm2 metadata.

  lvconvert -Zn --thinpool vg/data --poolmetadata vg/meta
2021-03-18 18:57:45 +01:00
Zdenek Kabelac
1c3774c7a8 pool: allow data on zero and error segtypes
Renables usage of --type zero and --type error LVs to serve as
backend for _tdata device. Clearly not very useful in practice,
as it can't store any real data, but usable for some testing
and some sort of perfomance checking.

  lvcreate --type zero -L1T -n pool vg
  lvconvert --thinpool vg/pool

Will create a thin-pool with zero device backend.
2021-03-18 18:57:45 +01:00
Zdenek Kabelac
7a9efc5fae lvresize: allow mixing striped with errors or zero
Enabled extension/mixing of stripes/linears, error and zero
segtype LVs with stripes/linear, error and zero segtypes.

It is not very useful in practice, as the user cannot store any real
data on error or zero segtypes, but it may get some uses in
some scenarios where i.e. some portion of the device should not be
readable. Mixing of types happens on 'extent_size' level:

  lvcreate -L1 -n lv vg
  lvextend --type error  -L+1 vg/lv
  lvextend --type zero   -L+1 vg/lv
  lvextend --type linear -L+1 vg/lv
  lvextend --type striped -L+1 vg/lv

  lvs -o+segtype,seg_size vg

Note: when the type is not specified, the last segment type is
automatically selected.

It's also a small 'can of worms' since we can't tell LVs if
the LV is linear/error/zero or their mixtures. So the meaning behind
them may need some updates.

We already have this types of LV created i.e by:

  vgreduce --removemissing --force

where missing LV segments have been replaced by either
error or zero segtype (lvm.conf).

TODO: it might be worth adding a message while such device is activated.
2021-03-18 18:56:49 +01:00
Zdenek Kabelac
b35ef9d67c segtypes: macros for error and zero segtypes 2021-03-18 18:34:57 +01:00
Zdenek Kabelac
22554c3ff0 lvremove: extra code for handling thinpool data
Add some extra code to handle differently sized thin-pool
from thin-pool data volume.

ATM this can't really happen, but once we start to use multiple
commits while resizing stacked LV, we may actually get into
the position, where data LV has been already resized,
but thin-pool stayed with old size.

But for now - report difference as internal error.
2021-03-18 18:34:57 +01:00
Zdenek Kabelac
5a73399b73 lvresize: support resize of stacked virtual LV
Update the LV stack with the size also for virtual LVs.
2021-03-18 18:34:57 +01:00
Zdenek Kabelac
adc238062d dev_manager: skip also zero targets
Devices made only from 'error' target cannot be used,
but if the device is also combined from 'zero' target
the same rule can be applied as such device cannot be used.
2021-03-18 18:34:57 +01:00
Zdenek Kabelac
a9b4acd511 dev_manager: add lv_raid_status
Just like with other segtype use this function to get whole
raid status info available per a single ioctl call.

Also it nicely simplifies read of percentage info about
in_sync portion of raid volume.

TODO: drop use of other calls then lv_raid_status call,
since all such calls could already use status - so it just
adds unnecessary duplication.
2021-03-18 18:34:57 +01:00
Zdenek Kabelac
e5a600860c dev_manager: status check with info check included
Reduce ioctl count and avoid separate info check,
when we can get the same info from status ioctl.

When devmanager calls return 0, then the exists value 0
means the reason of failure is missing device in table.
In such case we avoid stack trace.

Swap the flush parameter for the vdo status function
to match thin pool status.
2021-03-18 18:34:57 +01:00
Zdenek Kabelac
a60c8748ea thin: ignore parallel merge while polling
If the thin volume has no merging snapshot,
(being already merged) there is nothing to check.
2021-03-18 18:34:57 +01:00
Zdenek Kabelac
8cbe4a171e thin: add extra protection
Check explicitely created LV already has thin segment.
As currenlty it's the only user - this patch should have no impact.
2021-03-18 18:34:57 +01:00
Zdenek Kabelac
d682ad619a cleanup: simplier check first 2021-03-18 18:34:57 +01:00
David Teigland
a481fdaa35 man: lvmlockd use of lvmlockctl_kill_command 2021-03-17 13:02:51 -05:00
Zdenek Kabelac
583cf413d5 tests: avoid leaking unkilled commands
Between each new test here we want to kill previous commands,
otherwise they will influence results of next test.
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
fda7bc1297 tests: wait for Aa status 2021-03-17 00:59:50 +01:00
Zdenek Kabelac
80d0f200d0 tests: increase version of targets for progress 2021-03-17 00:59:50 +01:00
Zdenek Kabelac
e793ff1e18 tests: workaround for some raid targets
Problem with some target is that shortly after initialization it
returns incorrect status letters.
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
db37905d7f tests: no further fixes likely to be expected
Skip tests for these kernels.
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
87659256f0 tests: require newer version of raid target 2021-03-17 00:59:50 +01:00
Zdenek Kabelac
92ee16f7c0 tests: update mirror test
Log results of uniq.
Remove few unneeded lvs calls.
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
53bad89a7b tests: added check for kernel version
With older kernels this test can't work reliable,
since 'suspend' used to clean all dirty blocks
(taking even several seconds).
2021-03-17 00:59:50 +01:00
Zdenek Kabelac
8b2cdd8d3a debug: start with upper case
Use upper case letter to start sentence.
Also drop unneded check for vg as it's already non-null.
2021-03-17 00:50:40 +01:00
Zdenek Kabelac
94701b700b cleanup: use dm_strncpy
Use own function.
2021-03-17 00:50:22 +01:00
Zdenek Kabelac
4d75c4f597 device_is_usable: minor improve
Replace allocated buffer with local vg_name which doesn't
pass pointer to allocation.

Join some conditions together.
2021-03-17 00:49:11 +01:00
Zdenek Kabelac
0363e4de70 cleanup: typo 2021-03-15 18:59:15 +01:00