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

14332 Commits

Author SHA1 Message Date
Zdenek Kabelac
4e4067dd94 libdm: fix initialization of head for reused structure
Dmeventd reuses  'dm_task' struct for some STATUS operation, but due to
missing reinitization of dm_task target list, it has caused misprocesing
of recieved events as the parsed target has been simply added to the
list of existing status and cause multiple actions being called for
single event.
2017-06-26 19:45:11 +02:00
Zdenek Kabelac
0cc49bda15 tests: show more debug info
Helpful for analysis (revert later).
2017-06-24 23:02:42 +02:00
Zdenek Kabelac
1b9bf5ce9e tests: slightly longer delay
Try to avoid race with slightly longer delay.
2017-06-24 22:58:08 +02:00
Zdenek Kabelac
c465ca6a3a raid: allow more sync action for extraction
Since we discovered status reporting from 'md' goes from large set
of weird states we can't just decided based on this word.
So let it pass for rebuild and idle as well
and check for health devices afterwards.
2017-06-24 22:28:25 +02:00
Zdenek Kabelac
cac9e0b681 tests: correct percent values are reported 2017-06-24 17:44:42 +02:00
Zdenek Kabelac
cefb8bcfc4 tests: unit test for percent printing 2017-06-24 17:44:42 +02:00
Zdenek Kabelac
1bd4b0059b cleanup: use display_percent
Replace occurence of %.2f with call of display_percent function.
2017-06-24 17:44:42 +02:00
Zdenek Kabelac
07eec06f5d display: add display_percent function
Add universal function to print dm_percent_t values via single
code path.

TODO: extend with configurale precision of printed values.
2017-06-24 17:44:42 +02:00
Zdenek Kabelac
feed61f3fa libdm: use rounded float for percent print
Use new added  dm_percent_to_round_float to enhance print
of percentage values.
2017-06-24 17:44:42 +02:00
Zdenek Kabelac
2ef8da61eb libdm: implement dm_percent_to_round_float
Add function to adjust printing of percent values in better way.
Rounding here is going along following rules:

0% & 100% are always clearly reported with  .0 decimal points.

Values slightly above 0% we make sure a nearest bigger
non zero value with given precission is printed
(i.e. 0.01  for  %.2f  will be shown)

For values closely approaching 100% we again detect and adjust value
that is less then 100 when printed.
(i.e. 99.99  for %.2f will be shown).

For other values we are leaving them with standard rounding mechanism
since we care mainly about corner values 0 & 100 which need to be
printed precisely.
2017-06-24 17:44:40 +02:00
Zdenek Kabelac
0016b79c8b dmeventd: improve more raid status reporting
When we want to report primary leg failure, check for intial 'a',
since otherwice 'Aa idle' is normally visible.

Also reset array of bit flags marking dead devices, once
plugin detects raid is in sync.
2017-06-24 00:06:12 +02:00
Zdenek Kabelac
2a50a28f3e tests: use allocate policy in raid test 2017-06-23 23:32:44 +02:00
Zdenek Kabelac
1598bf154e tests: add transient failure test
Check raid  repairs still 'present', but failed device.

TODO: tests needs more checking about repair actually doing its work.
2017-06-23 23:32:44 +02:00
Zdenek Kabelac
f48d1bf147 tests: require also no 'a' for in-sync
Raid easily reports  'idle' with 'a', so in this case
we will not report in-sync.
2017-06-23 23:32:44 +02:00
Zdenek Kabelac
653bdedb83 raid: plugin does not to use --config
Functionality of ignore suspend devices is already granted by:

lvm2_disable_dmeventd_monitoring() -> init_run_by_dmeventd() ->
init_ignore_suspended_devices().

In fact plugins should never use --config because it has
some unpleasant technical issues.
2017-06-23 23:32:40 +02:00
Zdenek Kabelac
2b18be87aa raid: recognize transient failed raid leg
When raid leg rimage device is marked as 'D'ead by mdcore,
lvm2 was not able to replace such device with allocate policy,
as device has not appared as missing.

Add detection of transiently failing devices.
2017-06-23 23:27:07 +02:00
Zdenek Kabelac
535f7209d2 tests: request 1.12 for reshaping raid
We will need  1.12 as the kernel needs some mandatory md fixes,
otherwise random freezes may appear.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
d0c97b4401 tests: handle su login difference
Workaround case, where it matters if 'su' was user with '-' or without.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
cc03a872c0 cleanup: update messages 2017-06-23 18:44:01 +02:00
Zdenek Kabelac
a7c7d53543 debug: add missing internal error message
Do not just 'return_0'  log error would need to be shown.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
1bdcd156fd cache: restore origin only reload
Basically reverting commit 58a9f88b8c.
We can use origin_only  in case we are snapshot's origin,
as we do support this stack.

So when we are 'uncaching'  origin+snaps - we do need to reload only
origin and we do not need to play with snaps.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
63ecbcd1b7 raid: switch message to verbose
As this is not 'error' resulting query, decrease reported level.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
6d30350dd1 raid: improving messages for regionsize change
Handle change of 'region size' better and follow also standard rule
if the command can't success (i.e. size is already same) we return
error for all such cases.

Also log_pring more info about adjusted value (just like we
do for rounding)

Also avoid keep pointers on 'display_*' values - they are in
ringbuffer for immediate use - not to be kept across multiple calls
(as they could be already overwritten by later calls) - so dropped
seg_region_size_str
2017-06-23 18:44:00 +02:00
Zdenek Kabelac
cb2c2484b9 tests: flushing of cache is abortable 2017-06-22 20:17:20 +02:00
Zdenek Kabelac
7d5afcc0cb tests: check lvdisplay for cache works 2017-06-22 20:17:20 +02:00
Zdenek Kabelac
41c10034aa debug: show message only when origin_only was set 2017-06-22 20:17:20 +02:00
Zdenek Kabelac
58e075f5fb cache: fix lvdisplay output
Unused cache pool may have lots of fields actually undefined,
so avoid printing them, if they are not specified in metadata.
2017-06-22 20:17:18 +02:00
Zdenek Kabelac
732928dda8 cache: fix lvdisplay --maps
'lvdisplay -m' tried to go through NULL policy settings,
when such policy was not defined for CachedLV.

Patch is fixing display of cache-pool without defined settings,
as this is now a valid pool and we mostly want users to define
these settings when actually really caching a LV.
2017-06-22 20:15:12 +02:00
Zdenek Kabelac
58a9f88b8c cache: drop usage of origin_only
Since cache LV can be a stacked device, there is no real reason
trying to use slight optimised tree for origin_only cache reload
(it could be even wrongly implemented in this case).

We can easily go with stardard tree load here.
2017-06-22 20:14:31 +02:00
Zdenek Kabelac
ca9e6cec61 cache: make syncing abortable by user
When user runs command like 'lvconvert --splitcache' the operation
might be actually either slow or not making any progress in kernel,
so lets give user a chance to abort such operation.

When user press 'Ctrl+C' device table is restored to pre-flushing state.
2017-06-22 20:11:43 +02:00
Heinz Mauelshagen
2df9a78684 mirror: reformat conditional 2017-06-22 00:57:16 +02:00
Heinz Mauelshagen
64fac77e8a raid: fix segfault
Add missing else clause
(already missing in initial commit fe18e5e77a).

Resolves: rhbz1463794
2017-06-22 00:49:00 +02:00
Zdenek Kabelac
93fbfa2ed3 tests: lvresize needs --yes 2017-06-21 14:03:29 +02:00
Zdenek Kabelac
e3f63693a4 lvresize: support passing --yes to fsadm
Since fsadm now needs --yes to pass prompting operations,
we need to pass --yes from  lvresize to fsadm.
2017-06-21 14:03:29 +02:00
Zdenek Kabelac
48f06005ab raid: update path for repair
Updating path from commit 61980bcf06.

When repair is running, no removing PVS are given so it shall return
success in such case.
2017-06-21 14:00:50 +02:00
Zdenek Kabelac
5f4cfa7c4a debug: missing traces 2017-06-21 12:36:01 +02:00
Zdenek Kabelac
07fe64b473 raid: use log_error on error path
Converting log_warn to log_error since error must be logged
when tool returns error.
2017-06-21 12:35:17 +02:00
Zdenek Kabelac
61980bcf06 raid: report error when specified devices are not contained
lvm2 always return non-zero error code when action cannot happen.
2017-06-21 12:35:17 +02:00
Zdenek Kabelac
31d153ced0 raid: drop debug code 2017-06-21 12:35:16 +02:00
Zdenek Kabelac
49fa2bea1c raid: more origin_only updates
Seems the code is multiplied - so keep it consistent for now.

TODO:  drop all uneeded code
2017-06-21 12:35:16 +02:00
Heinz Mauelshagen
1766eaec4b lvconvert: provide better reshape reject message for open RaidLV
On commits
5e611c700b and
601ad1c73f.

Related: rhbz1447812
2017-06-20 19:06:18 +02:00
Heinz Mauelshagen
76314183e2 raid: avoid explicit activation of SubLVs on reshape/takeover
Remove explicit activation of SubLVs and let lv_update_and_reload()
perform the proper (pre-)loading sequencing of tables.
This avoids related callback functions which are removed.

Related: rhbz1448116
Related: rhbz1461526
Related: rhbz1448123
2017-06-20 18:56:45 +02:00
Heinz Mauelshagen
0dfe1bc29d raid: provide clickable URL BZ references 2017-06-20 18:43:26 +02:00
Zdenek Kabelac
710f51e7f2 tests: test also different lock holder 2017-06-20 18:25:10 +02:00
Zdenek Kabelac
3d591ac376 tests: avoid double lines
Skip showing same line twice in test's verbose log.
2017-06-20 18:24:52 +02:00
Zdenek Kabelac
1ea41b6d48 activation: fix usage of origin_only
When lock-holding LV differs from actually request locked LV,
we drop  origin_only flag as it has no use - it'd be applied
on completely different LV.

Example of problem:

Raid is  thin-pool _tdata LV.
Raid run  origin_only locking on stacked device.
As lock holder is discovered thinLV.
Whole origin_only operation is then applied only on thinLV
changing the meaning of whole operation.

NOTE: this patch does not change anything for LV that are
already top-level lock holding LVs (i.e. thinLVs, snahoshots/origins).
2017-06-20 18:23:24 +02:00
Heinz Mauelshagen
5e611c700b lvconvert: check open count to disable reshaping of open RAID LV
Also check LV open count in addition to opening the RaidLV
exclusively as of commit 601ad1c73f.

Related: rhbz1447812
2017-06-20 17:59:10 +02:00
Heinz Mauelshagen
601ad1c73f lvconvert: enhance disable reshaping of open RAID LV
Enhance commit 9e9163618a
to use dev_open_flags/dev_close API.

Related: rhbz1447812
2017-06-20 17:27:58 +02:00
Zdenek Kabelac
31cd01c9b3 tests: check conversion of thin-pool 2017-06-19 23:30:11 +02:00
Zdenek Kabelac
19cc03fa52 thin: restore conversion to raid
Since commit  1bc546269a we've disabled
coversion of raid. This however already got fixed, so reenable
commands like:  'lvconvert --type raid1 vg/pool_tdata'.
2017-06-19 23:30:08 +02:00