]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agocleanup: use display_percent
Zdenek Kabelac [Sat, 24 Jun 2017 14:22:36 +0000 (16:22 +0200)]
cleanup: use display_percent

Replace occurence of %.2f with call of display_percent function.

7 years agodisplay: add display_percent function
Zdenek Kabelac [Sat, 24 Jun 2017 14:03:21 +0000 (16:03 +0200)]
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.

7 years agolibdm: use rounded float for percent print
Zdenek Kabelac [Sat, 24 Jun 2017 14:39:50 +0000 (16:39 +0200)]
libdm: use rounded float for percent print

Use new added  dm_percent_to_round_float to enhance print
of percentage values.

7 years agolibdm: implement dm_percent_to_round_float
Zdenek Kabelac [Sat, 24 Jun 2017 11:24:26 +0000 (13:24 +0200)]
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.

7 years agodmeventd: improve more raid status reporting
Zdenek Kabelac [Fri, 23 Jun 2017 22:06:12 +0000 (00:06 +0200)]
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.

7 years agotests: use allocate policy in raid test
Zdenek Kabelac [Fri, 23 Jun 2017 21:22:34 +0000 (23:22 +0200)]
tests: use allocate policy in raid test

7 years agotests: add transient failure test
Zdenek Kabelac [Fri, 23 Jun 2017 21:20:01 +0000 (23:20 +0200)]
tests: add transient failure test

Check raid  repairs still 'present', but failed device.

TODO: tests needs more checking about repair actually doing its work.

7 years agotests: require also no 'a' for in-sync
Zdenek Kabelac [Fri, 23 Jun 2017 19:14:29 +0000 (21:14 +0200)]
tests: require also no 'a' for in-sync

Raid easily reports  'idle' with 'a', so in this case
we will not report in-sync.

7 years agoraid: plugin does not to use --config
Zdenek Kabelac [Fri, 23 Jun 2017 19:15:37 +0000 (21:15 +0200)]
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.

7 years agoraid: recognize transient failed raid leg
Zdenek Kabelac [Fri, 23 Jun 2017 20:50:19 +0000 (22:50 +0200)]
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.

7 years agotests: request 1.12 for reshaping raid
Zdenek Kabelac [Fri, 23 Jun 2017 12:52:34 +0000 (14:52 +0200)]
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.

7 years agotests: handle su login difference
Zdenek Kabelac [Fri, 23 Jun 2017 13:11:26 +0000 (15:11 +0200)]
tests: handle su login difference

Workaround case, where it matters if 'su' was user with '-' or without.

7 years agocleanup: update messages
Zdenek Kabelac [Fri, 23 Jun 2017 08:59:12 +0000 (10:59 +0200)]
cleanup: update messages

7 years agodebug: add missing internal error message
Zdenek Kabelac [Fri, 23 Jun 2017 12:41:10 +0000 (14:41 +0200)]
debug: add missing internal error message

Do not just 'return_0'  log error would need to be shown.

7 years agocache: restore origin only reload
Zdenek Kabelac [Fri, 23 Jun 2017 15:05:24 +0000 (17:05 +0200)]
cache: restore origin only reload

Basically reverting commit 58a9f88b8c021a5e056b883053f257f1a898adf7.
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.

7 years agoraid: switch message to verbose
Zdenek Kabelac [Fri, 23 Jun 2017 09:14:31 +0000 (11:14 +0200)]
raid: switch message to verbose

As this is not 'error' resulting query, decrease reported level.

7 years agoraid: improving messages for regionsize change
Zdenek Kabelac [Fri, 23 Jun 2017 12:40:10 +0000 (14:40 +0200)]
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

7 years agotests: flushing of cache is abortable
Zdenek Kabelac [Thu, 22 Jun 2017 18:09:00 +0000 (20:09 +0200)]
tests: flushing of cache is abortable

7 years agotests: check lvdisplay for cache works
Zdenek Kabelac [Thu, 22 Jun 2017 18:08:24 +0000 (20:08 +0200)]
tests: check lvdisplay for cache works

7 years agodebug: show message only when origin_only was set
Zdenek Kabelac [Thu, 22 Jun 2017 15:14:47 +0000 (17:14 +0200)]
debug: show message only when origin_only was set

7 years agocache: fix lvdisplay output
Zdenek Kabelac [Thu, 22 Jun 2017 18:05:26 +0000 (20:05 +0200)]
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.

7 years agocache: fix lvdisplay --maps
Zdenek Kabelac [Thu, 22 Jun 2017 17:53:27 +0000 (19:53 +0200)]
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.

7 years agocache: drop usage of origin_only
Zdenek Kabelac [Thu, 22 Jun 2017 15:12:27 +0000 (17:12 +0200)]
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.

7 years agocache: make syncing abortable by user
Zdenek Kabelac [Thu, 22 Jun 2017 15:08:47 +0000 (17:08 +0200)]
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.

7 years agomirror: reformat conditional
Heinz Mauelshagen [Wed, 21 Jun 2017 22:57:16 +0000 (00:57 +0200)]
mirror: reformat conditional

7 years agoraid: fix segfault
Heinz Mauelshagen [Wed, 21 Jun 2017 22:49:00 +0000 (00:49 +0200)]
raid: fix segfault

Add missing else clause
(already missing in initial commit fe18e5e77a488618510648c7801ea3375ce5aac4).

Resolves: rhbz1463794

7 years agotests: lvresize needs --yes
Zdenek Kabelac [Wed, 21 Jun 2017 11:58:55 +0000 (13:58 +0200)]
tests: lvresize needs --yes

7 years agolvresize: support passing --yes to fsadm
Zdenek Kabelac [Wed, 21 Jun 2017 12:02:57 +0000 (14:02 +0200)]
lvresize: support passing --yes to fsadm

Since fsadm now needs --yes to pass prompting operations,
we need to pass --yes from  lvresize to fsadm.

7 years agoraid: update path for repair
Zdenek Kabelac [Wed, 21 Jun 2017 11:57:22 +0000 (13:57 +0200)]
raid: update path for repair

Updating path from commit 61980bcf0624790bfdc07d371fd510d1c4079fb5.

When repair is running, no removing PVS are given so it shall return
success in such case.

7 years agodebug: missing traces
Zdenek Kabelac [Wed, 21 Jun 2017 09:29:16 +0000 (11:29 +0200)]
debug: missing traces

7 years agoraid: use log_error on error path
Zdenek Kabelac [Wed, 21 Jun 2017 09:58:38 +0000 (11:58 +0200)]
raid: use log_error on error path

Converting log_warn to log_error since error must be logged
when tool returns error.

7 years agoraid: report error when specified devices are not contained
Zdenek Kabelac [Wed, 21 Jun 2017 09:45:20 +0000 (11:45 +0200)]
raid: report error when specified devices are not contained

lvm2 always return non-zero error code when action cannot happen.

7 years agoraid: drop debug code
Zdenek Kabelac [Wed, 21 Jun 2017 09:09:47 +0000 (11:09 +0200)]
raid: drop debug code

7 years agoraid: more origin_only updates
Zdenek Kabelac [Wed, 21 Jun 2017 09:17:03 +0000 (11:17 +0200)]
raid: more origin_only updates

Seems the code is multiplied - so keep it consistent for now.

TODO:  drop all uneeded code

7 years agolvconvert: provide better reshape reject message for open RaidLV
Heinz Mauelshagen [Tue, 20 Jun 2017 17:06:18 +0000 (19:06 +0200)]
lvconvert: provide better reshape reject message for open RaidLV

On commits
5e611c700ba1032ffb71bf0cdd33e062e5e16439 and
601ad1c73faa5fe3d74ff5b06cc47073b40a1850.

Related: rhbz1447812

7 years agoraid: avoid explicit activation of SubLVs on reshape/takeover
Heinz Mauelshagen [Tue, 20 Jun 2017 16:56:45 +0000 (18:56 +0200)]
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

7 years agoraid: provide clickable URL BZ references
Heinz Mauelshagen [Tue, 20 Jun 2017 16:42:09 +0000 (18:42 +0200)]
raid: provide clickable URL BZ references

7 years agotests: test also different lock holder
Zdenek Kabelac [Tue, 20 Jun 2017 16:22:17 +0000 (18:22 +0200)]
tests: test also different lock holder

7 years agotests: avoid double lines
Zdenek Kabelac [Tue, 20 Jun 2017 15:15:07 +0000 (17:15 +0200)]
tests: avoid double lines

Skip showing same line twice in test's verbose log.

7 years agoactivation: fix usage of origin_only
Zdenek Kabelac [Tue, 20 Jun 2017 15:11:42 +0000 (17:11 +0200)]
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).

7 years agolvconvert: check open count to disable reshaping of open RAID LV
Heinz Mauelshagen [Tue, 20 Jun 2017 15:59:10 +0000 (17:59 +0200)]
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 601ad1c73faa5fe3d74ff5b06cc47073b40a1850.

Related: rhbz1447812

7 years agolvconvert: enhance disable reshaping of open RAID LV
Heinz Mauelshagen [Tue, 20 Jun 2017 15:27:58 +0000 (17:27 +0200)]
lvconvert: enhance disable reshaping of open RAID LV

Enhance commit 9e9163618ab36a6b046b6380d6ef58429b219ef8
to use dev_open_flags/dev_close API.

Related: rhbz1447812

7 years agotests: check conversion of thin-pool
Zdenek Kabelac [Mon, 19 Jun 2017 21:15:46 +0000 (23:15 +0200)]
tests: check conversion of thin-pool

7 years agothin: restore conversion to raid
Zdenek Kabelac [Mon, 19 Jun 2017 21:11:11 +0000 (23:11 +0200)]
thin: restore conversion to raid

Since commit  1bc546269a7d2cae156827e282715410a4967d51 we've disabled
coversion of raid. This however already got fixed, so reenable
commands like:  'lvconvert --type raid1 vg/pool_tdata'.

7 years agolvconvert: disable reshaping of open RAID LV
Heinz Mauelshagen [Mon, 19 Jun 2017 20:25:54 +0000 (22:25 +0200)]
lvconvert: disable reshaping of open RAID LV

Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation.

Related: rhbz1447812

7 years agolvconvert: enhance message
Heinz Mauelshagen [Mon, 19 Jun 2017 19:40:38 +0000 (21:40 +0200)]
lvconvert: enhance message

Enhance message introduced by last
commit f342e803ba3c32890a2b08736fa94bdd541d5e9c.

Related: rhbz1439399

7 years agolvconvert: disable conversion of RAID LV under snapshot
Heinz Mauelshagen [Mon, 19 Jun 2017 19:08:52 +0000 (21:08 +0200)]
lvconvert: disable conversion of RAID LV under snapshot

Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation.

Related: rhbz1439399

7 years agolvconvert: disable reshaping of RAID LVs in the cluster
Heinz Mauelshagen [Mon, 19 Jun 2017 18:01:01 +0000 (20:01 +0200)]
lvconvert: disable reshaping of RAID LVs in the cluster

Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation in the cluster.

Related: rhbz1448116
Related: rhbz1461526
Related: rhbz1448123

7 years agofsadm: restore no answer
Zdenek Kabelac [Mon, 19 Jun 2017 10:37:40 +0000 (12:37 +0200)]
fsadm: restore no answer

Commit 1fe4f80e45a6bfcceed5aaab97fc0e27dfcf2b88 in current version
introduced regression for a terminal user, as he could not enter 'n'
as answer. Add missing break for this case (No whats_new).

7 years agotest: New test file for validating kernel status during sync ops
Jonathan Brassow [Fri, 16 Jun 2017 15:11:58 +0000 (10:11 -0500)]
test: New test file for validating kernel status during sync ops

New tests to add checking for '100%' in-sync at start of "recover"
process (it shouldn't happen, but I've seen it before).  Also,
check status over the whole cycle of various sync processes ("resync"
and "recover").

7 years agotests: use exclusive activation
Zdenek Kabelac [Wed, 14 Jun 2017 11:59:11 +0000 (13:59 +0200)]
tests: use exclusive activation

Conversion needs exlusively active LV for clustered testing.

7 years agodebug: passing non-raid seg would be internal error
Zdenek Kabelac [Fri, 16 Jun 2017 14:24:38 +0000 (16:24 +0200)]
debug: passing non-raid seg would be internal error

7 years agocleanup: drop unused parameter
Zdenek Kabelac [Thu, 15 Jun 2017 09:21:06 +0000 (11:21 +0200)]
cleanup: drop unused parameter

7 years agocleanup: show what happens when passed prompt
Zdenek Kabelac [Thu, 15 Jun 2017 09:53:01 +0000 (11:53 +0200)]
cleanup: show what happens when passed prompt

When we show prompt and user passes --yes - we still
do tell user which action is going to happen.

7 years agocleanup: improve debug tracing
Zdenek Kabelac [Wed, 14 Jun 2017 14:26:35 +0000 (16:26 +0200)]
cleanup: improve debug tracing

7 years agocleanup: use 'dm_get_status_raid'
Zdenek Kabelac [Fri, 16 Jun 2017 08:48:38 +0000 (10:48 +0200)]
cleanup: use 'dm_get_status_raid'

Use single 'dm' call to parse raid status.
(Avoiding multiple parsers - even when we know it's slighly
less efficient).

7 years agoraid: report percent with segtype info
Zdenek Kabelac [Fri, 16 Jun 2017 11:20:25 +0000 (13:20 +0200)]
raid: report percent with segtype info

Enhance reporting code, so it does not need to do 'extra' ioctl to
get 'status' of normal raid and provide percentage directly.

When we have 'merging' snapshot into raid origin, we still need to get
this secondary number with extra status call - however, since  'raid'
is always a single segment LV - we may skip 'copy_percent' call as
we directly know the percent and also with better precision.

NOTE: for mirror we still base reported number on the percetage of
transferred extents which might get quite imprecisse if big size
of extent is used while volume itself is smaller as reporting jump
steps are much bigger the actual reported number provides.

2nd.NOTE: raid lvs line report already requires quite a few extra status
calls for the same device - but fix will be need slight code improval.

7 years agolibdm: workarounds reported raid status info
Zdenek Kabelac [Fri, 16 Jun 2017 11:20:47 +0000 (13:20 +0200)]
libdm: workarounds reported raid status info

Current existing kernels reports status sometimes in weird form.

Instead of showing what is the exact progress, we need to estimate
this in-sync state from several surrounding states.

Main reason here is to never report 100% sync state for a raid device
which will be undergoing i.e. recovery.

7 years agoraid: adjust reshape feature flag check
Heinz Mauelshagen [Fri, 16 Jun 2017 13:58:47 +0000 (15:58 +0200)]
raid: adjust reshape feature flag check

Relative to last comit ddf2a1d6564800f6d7f87e91cb8a7dfaa0edac1f:

adjust the dm-raid target version to 1.12.0 which shows
mandatory kernel MD deadlock fixes related to reshaping
are presant in the kernel.

Related: rhbz1443999

7 years agoRevert "lvconvert: reject changing number of stripes on single core
Heinz Mauelshagen [Fri, 16 Jun 2017 13:43:23 +0000 (15:43 +0200)]
Revert "lvconvert: reject changing number of stripes on single core

This reverts commit 3719f4bc5441cb5f29ad4beb91ccaa6b234ea8e1
to allow for single core testing on kernels with deadlock
fixes relative to rhbz1443999."

7 years agotest: New test file for validating kernel status during sync ops
Jonathan Brassow [Thu, 15 Jun 2017 16:06:08 +0000 (11:06 -0500)]
test: New test file for validating kernel status during sync ops

First test in this file checks whether 'aa' is ever spotted during
a "recover" operation (it should not be).  More tests should follow
in this file to look for oddities in status output - especially as
it relates to the sync_ratio, dev_health, and sync_action fields.

7 years agoclean-up: Very picky update to comment - hopefully making it clearer
Jonathan Brassow [Wed, 14 Jun 2017 20:22:04 +0000 (15:22 -0500)]
clean-up:  Very picky update to comment - hopefully making it clearer

7 years agoclean-ups: remove unused var, add 'static' for local fn, adjust test
Jonathan Brassow [Wed, 14 Jun 2017 19:49:42 +0000 (14:49 -0500)]
clean-ups:  remove unused var, add 'static' for local fn, adjust test

For the test clean-up, I was providing too many devices to the first
command - possibly allowing it to allocate in the wrong place.  I was
also not providing a device for the second command - virtually ensuring
the test was not performing correctly at times.

7 years agolvconvert: Disallow removal of primary when up-converting (recovering)
Jonathan Brassow [Wed, 14 Jun 2017 13:41:05 +0000 (08:41 -0500)]
lvconvert: Disallow removal of primary when up-converting (recovering)

This patch ensures that under normal conditions (i.e. not during repair
operations) that users are prevented from removing devices that would
cause data loss.

When a RAID1 is undergoing its initial sync, it is ok to remove all but
one of the images because they have all existed since creation and
contain all the data written since the array was created.  OTOH, if the
RAID1 was created as a result of an up-convert from linear, it is very
important not to let the user remove the primary image (the source of
all the data).  They should be allowed to remove any devices they want
and as many as they want as long as one original (primary) device is left
during a "recover" (aka up-convert).

This fixes bug 1461187 and includes the necessary regression tests.

7 years agoRAID (lvconvert/dmeventd): Cleanly handle primary failure during 'recover' op
Jonathan Brassow [Wed, 14 Jun 2017 13:39:50 +0000 (08:39 -0500)]
RAID (lvconvert/dmeventd):  Cleanly handle primary failure during 'recover' op

Add the checks necessary to distiguish the state of a RAID when the primary
source for syncing fails during the "recover" process.

It has been possible to hit this condition before (like when converting from
2-way RAID1 to 3-way and having the first two devices die during the "recover"
process).  However, this condition is now more likely since we treat linear ->
RAID1 conversions as "recover" now - so it is especially important we cleanly
handle this condition.

7 years agolvconvert: Don't require a 'force' option during RAID repair.
Jonathan Brassow [Wed, 14 Jun 2017 13:39:07 +0000 (08:39 -0500)]
lvconvert:  Don't require a 'force' option during RAID repair.

Previously, we were treating non-RAID to RAID up-converts as a "resync"
operation.  (The most common example being 'linear -> RAID1'.)  RAID to
RAID up-converts or rebuilds of specific RAID images are properly treated
as a "recover" operation.

Since we were treating some up-convert operations as "resync", it was
possible to have scenarios where data corruption or data loss were
possibilities if the RAID hadn't been able to sync completely before a
loss of the primary source devices.  In order to ensure that the user took
the proper precautions in such scenarios, we required a '--force' option
to be present.  Unfortuneately, the force option was rendered useless
because there was no way to distiguish the failure state of a potentially
destructive repair from a nominal one - making the '--force' option a
requirement for any RAID1 repair!

We now treat non-RAID to RAID up-converts properly as "recover" operations.
This eliminates the scenarios that can potentially cause data loss or
data corruption; and this eliminates the need for the '--force' requirement.
This patch removes the requirement to specify '--force' for RAID repairs.

7 years agolvconvert: linear -> raid1 upconvert should cause "recover" not "resync"
Jonathan Brassow [Wed, 14 Jun 2017 13:33:42 +0000 (08:33 -0500)]
lvconvert:  linear -> raid1 upconvert should cause "recover" not "resync"

Two of the sync actions performed by the kernel (aka MD runtime) are
"resync" and "recover".  The "resync" refers to when an entirely new array
is going through the process of initializing (or resynchronizing after an
unexpected shutdown).  The "recover" is the process of initializing a new
member device to the array.  So, a brand new array with all new devices
will undergo "resync".  An array with replaced or added sub-LVs will undergo
"recover".

These two states are treated very differently when failures happen.  If any
device is lost or replaced while "resync", there are no worries.  This is
because any writes created from the inception of the array have occurred to
all the devices and can be safely recovered.  Even though non-initialized
portions will still be resync'ed with uninitialized data, it is ok.  However,
if a pre-existing device is lost (aka, the original linear device in a
linear -> raid1 convert) during a "recover", data loss can be the result.
Thus, writes are errored by the kernel and recovery is halted.  The failed
device must be restored or removed.  This is the correct behavior.

Unfortunately, we were treating an up-convert from linear as a "resync"
when we should have been treating it as a "recover".  This patch
removes the special case for linear upconvert.  It allows each new image
sub-LV to be marked with a rebuild flag and treats the array as 'in-sync'.
This has the correct effect of causing the upconvert to be treated as a
"recover" rather than a "resync".  There is no need to flag these two states
differently in LVM metadata, because they are already considered differently
by the kernel RAID metadata.  (Any activation/deactivation will properly
resume the "recover" process and not a "resync" process.)

We make this behavior change based on the presense of dm-raid target
version 1.9.0+.

7 years agoraid: change reshape segtype flags
Heinz Mauelshagen [Wed, 14 Jun 2017 13:01:19 +0000 (15:01 +0200)]
raid: change reshape segtype flags

Commit 1c916ec5ffd37cfb7be2101b93a2dc91aa2ef7f0
missed new reshape flags.

7 years agolvconvert: fix detached SubLV deactivation in cluster
Heinz Mauelshagen [Tue, 13 Jun 2017 21:15:51 +0000 (23:15 +0200)]
lvconvert: fix detached SubLV deactivation in cluster

On conversion from raid10 to raid0 (takeover), all rmeta
devices and the rimage devices of mirrored stripes are
detached from the raid10 LV. The remaining rimage areas
are being shifted down into the slots of the detached
ones hence requiring renames to show proper _N suffix
sequences (e.g. 0,1,2,3 instead of 0,2,4,6).  Only the
top-level raid10 LV has a cluster lock, not the detached
SubLVs thus their deactivation is impossible and e.g the
rename from *_rimage_6 to *_rimage_3 will fail.  Fix by
activating exclusively before deactivating and removing.

Resolves: rhbz1448123

7 years agodmfilemapd: do not wait if file has been truncated
Bryn M. Reeves [Wed, 7 Jun 2017 18:29:16 +0000 (19:29 +0100)]
dmfilemapd: do not wait if file has been truncated

7 years agodmfilemapd: update file block count at daemon start
Bryn M. Reeves [Wed, 7 Jun 2017 18:26:09 +0000 (19:26 +0100)]
dmfilemapd: update file block count at daemon start

The file block count stored in the filemap_monitor was lazily
initialised at the time of the first check. This causes problems
in the case that the file has been truncated between this time and
the time the daemon started: the initial block count and current
block count match and the daemon fails to detect a change.

Separate the setting of the block count from the check and make a
call to update the value at the start of _dmfilemapd().

7 years agolibdm: allow truncated files in dm_stats_update_regions_from_fd()
Bryn M. Reeves [Wed, 7 Jun 2017 18:21:10 +0000 (19:21 +0100)]
libdm: allow truncated files in dm_stats_update_regions_from_fd()

It's not an error to attempt to update regions from an fd that has
been truncated (or otherwise no longer has any allocated extents):
in this case, the call should remove all regions corresponding to
the group, and return an empty region table.

7 years agoconfigure: update
Zdenek Kabelac [Fri, 9 Jun 2017 20:50:40 +0000 (22:50 +0200)]
configure: update

7 years agoconfigure: search for (a possibly prefixed) ar
Heiko Becker [Thu, 13 Apr 2017 07:07:49 +0000 (09:07 +0200)]
configure: search for (a possibly prefixed) ar

e.g. when cross compiling.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
7 years agoconfigure: improve reporting about readline
Zdenek Kabelac [Fri, 9 Jun 2017 20:40:27 +0000 (22:40 +0200)]
configure: improve reporting about readline

Report real 'readline' supporting state instead of 'maybe'.
Really check for 'readline' headers.

7 years agoconfigure: warn about older version of cache_check
Zdenek Kabelac [Fri, 9 Jun 2017 20:30:23 +0000 (22:30 +0200)]
configure: warn about older version of cache_check

For proper usage of Cache kernel metadata format V2,
new cache_check tool is basically mandatory.

Print warning during configure time about this problem.

7 years agoraid: add reshape segtype flag support
Heinz Mauelshagen [Fri, 9 Jun 2017 19:31:09 +0000 (21:31 +0200)]
raid: add reshape segtype flag support

Prohibit activation of reshaping RaidLVs on incompatible
lvm2 runtime by storing e.g. 'raid5+RESHAPE' segment type
strings in the lvm2 metadata.  Incompatible runtime not
supporting reshaping won't be able to activate those thus
avoiding potential data corruption.

Any new non-reshaping lvconvert command will reset the
segment type string from 'raid5+RESHAPE' to 'raid5'.

See commits
0299a7af1ec1eeb11388ed15c4c78f224fee76b2 and
4141409eb09e78aef030346995f1722fb40956d8
for segtype flag support.

7 years agoindent: properly indent goto
Zdenek Kabelac [Fri, 9 Jun 2017 12:52:40 +0000 (14:52 +0200)]
indent: properly indent goto

7 years agocleanup: update message
Zdenek Kabelac [Fri, 9 Jun 2017 19:31:02 +0000 (21:31 +0200)]
cleanup: update message

7 years agocleanup: define really uses KB
Zdenek Kabelac [Fri, 9 Jun 2017 19:29:34 +0000 (21:29 +0200)]
cleanup: define really uses KB

Cleanup also units for DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE define
(128MB) and update calcs for it.

7 years agosnapshot: fix reporting for merged old snapshot
Zdenek Kabelac [Fri, 9 Jun 2017 19:00:05 +0000 (21:00 +0200)]
snapshot: fix reporting for merged old snapshot

When old snapshot is merged, lvm2 still can report some data about
merged 'snapshot' - i.e. it occupied space in VG.

This patch fixes regression from commit:
6fd20be629b6dceb96702c5f875a2e612e6f465d

and resolved RHBZ: 1460161

7 years agotests: no longer allowed too big thin-pools for small chunks
Zdenek Kabelac [Fri, 9 Jun 2017 10:58:25 +0000 (12:58 +0200)]
tests: no longer allowed too big thin-pools for small chunks

7 years agoconfigure: report yes or no for wiping and system
Zdenek Kabelac [Fri, 9 Jun 2017 10:56:55 +0000 (12:56 +0200)]
configure: report yes or no for wiping and system

Avoid reporting 'checking result' as maybe - it should
clearly tell 'yes' or 'no'.

Just shuffle printed message to the place, where we
already know the 'maybe' answer.

So instead of printing 'unclear':

checking whether to enable libblkid detection of signatures when wiping... maybe
checking for BLKID... yes
checking whether to use udev-systemd protocol for jobs in background... maybe
checking for SYSTEMD... yes

show this:

checking for BLKID... yes
checking whether to enable libblkid detection of signatures when wiping... yes
checking for SYSTEMD... yes
checking whether to use udev-systemd protocol for jobs in background... yes

7 years agocache: lvcreate --cachepool checks for cache pool
Zdenek Kabelac [Fri, 9 Jun 2017 08:59:37 +0000 (10:59 +0200)]
cache: lvcreate --cachepool checks for cache pool

Code path missed validation of lvcreate --cachepool argument.
If the non cache-pool LV was passed in, code has still continued
further work and failed later on internal error.  Validate this
condition at right place now.

7 years agotests: fix compilation of unit tests
Zdenek Kabelac [Tue, 6 Jun 2017 13:38:45 +0000 (15:38 +0200)]
tests: fix compilation of unit tests

Rule for TARGET compiling got missing and needs to be explicitely
expressed, otherwise default unsuitable rule is applied.

7 years agotests: check thin-pool boundary sizes
Zdenek Kabelac [Thu, 8 Jun 2017 09:45:14 +0000 (11:45 +0200)]
tests: check thin-pool boundary sizes

7 years agothin: disallow creation of too big thin pools
Zdenek Kabelac [Thu, 8 Jun 2017 08:46:22 +0000 (10:46 +0200)]
thin: disallow creation of too big thin pools

When a combination of thin-pool chunk size and thin-pool data size
goes beyond addressable limit, such volume creation is directly
prohibited.

Maximum usable thin-pool size is calculated with use of maximal support
metadata size (even when it's created smaller) and given chunk-size.
If the value data size is found to be too big, the command reports
error and operation fails.

Previously thin-pool was created however lots of thin-pool data LV was
not usable and this space in VG has been wasted.

7 years agocleanup: use DM limit define
Zdenek Kabelac [Mon, 5 Jun 2017 09:26:01 +0000 (11:26 +0200)]
cleanup: use DM limit define

For calculation use already defined size in libdm, which give better
estimation of maximal size of thin pool metadata.

7 years agocleanup: rename internal define
Zdenek Kabelac [Fri, 2 Jun 2017 09:18:04 +0000 (11:18 +0200)]
cleanup: rename internal define

More descriptive name of #define.

7 years agolvconvert: reject RAID conversions on inactive LVs
Heinz Mauelshagen [Wed, 7 Jun 2017 16:37:04 +0000 (18:37 +0200)]
lvconvert: reject RAID conversions on inactive LVs

Only support RAID conversions on active LVs.

If we'd accept e.g. upconverting linear -> raid1 on inactive
linear LVs, any LV flags passed to the kernel aren't properly
cleared thus errouneously passing them on every activation.

Add respective check to lv_raid_change_image_count() and
move existing one in lv_raid_convert() for better messages.

7 years agolvmdbusd: Prevent stall when update thread gets exception
Tony Asleson [Fri, 2 Jun 2017 17:29:27 +0000 (12:29 -0500)]
lvmdbusd: Prevent stall when update thread gets exception

If during the process of fetching current lvm state we experience an
exception we fail to call set_result on the queued_requests we were
processing.  When this happens those threads block forever which causes
the service to stall infinitely.  Only clear the queued_requests after
we have called set_result.

7 years agolvmdbusd: Add background command to flight recorder
Tony Asleson [Fri, 2 Jun 2017 17:25:01 +0000 (12:25 -0500)]
lvmdbusd: Add background command to flight recorder

We were not adding background tasks to flight recorder.  Add the meta
data to the flight recorder when we start the command and update the meta
data when the command is finished.  Locking was added to meta data to
prevent concurrent update and returning string representation as these can
happen in two different threads.

7 years agolvmdbusd: cmdhandler.py vg_reduce, remove extranous '--all'
Tony Asleson [Fri, 2 Jun 2017 17:22:24 +0000 (12:22 -0500)]
lvmdbusd: cmdhandler.py vg_reduce, remove extranous '--all'

vgreduce previously allowed --all and --removemissing together even though
it only actual did the remove missing.  The lvm dbus daemon was passing
--all anytime there was no entries in pv_object_paths.  This change supplies
--all if and only if we are not removing missing and the pv_object_paths
is empty.

Vgreduce has and continues to enforce the invalid combination of supplying a
device list when you specify --all or --removemissing so we do not need
to check for that invalid combination explicitly in the lvm dbus service as
it's already covered.

Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1455471

7 years agolvconvert: choose direct path to desired raid level
Heinz Mauelshagen [Fri, 2 Jun 2017 12:30:57 +0000 (14:30 +0200)]
lvconvert: choose direct path to desired raid level

Remove superfluous raid5_n interim LV type from raid4 -> raid10 conversion.

Resolves: rhbz1458006

7 years agoprint warning about in-use orphans
David Teigland [Thu, 1 Jun 2017 16:10:09 +0000 (11:10 -0500)]
print warning about in-use orphans

Warn about a PV that has the in-use flag set, but appears in
the orphan VG (no VG was found referencing it.)

There are a number of conditions that could lead to this:

. The PV was created with no mdas and is used in a VG with
  other PVs (with metadata) that have not yet appeared on
  the system.  So, no VG metadata is found by lvm which
  references the in-use PV with no mdas.

. vgremove could have failed after clearing mdas but
  before clearing the in-use flag.  In this case, the
  in-use flag needs to be manually cleared on the PV.

. The PV may have damanged/unrecognized VG metadata
  that lvm could not read.

. The PV may have no mdas, and the PVs with the metadata
  may have damaged/unrecognized metadata.

7 years agodisable repairing in-use flag on orphan PVs
David Teigland [Fri, 26 May 2017 18:26:09 +0000 (13:26 -0500)]
disable repairing in-use flag on orphan PVs

A PV holding VG metadata that lvm can't understand
(e.g. damaged, checksum error, unrecognized flag)
will appear as an in-use orphan, and will be cleared
by this repair code.  Disable this repair until the
code can keep track of these problematic PVs, and
distinguish them from actual in-use orphans.

7 years agotests: longer delay
Zdenek Kabelac [Wed, 31 May 2017 11:58:19 +0000 (13:58 +0200)]
tests: longer delay

Slower sync a bit more and use bigger raid arrays to
be more sure we will catch raid being sychronized.

7 years agotests: add some extra udev waits
Zdenek Kabelac [Wed, 31 May 2017 11:23:34 +0000 (13:23 +0200)]
tests: add some extra udev waits

To get less random results on older systems with systemd (i.e. fc23)
put few extra udev wait operations to avoid any udev event collision.

7 years agotests: skip reshaping raid10
Zdenek Kabelac [Wed, 31 May 2017 10:59:53 +0000 (12:59 +0200)]
tests: skip reshaping raid10

Needs newer target  >= 1.10.1 for reshaping of raid10 LVs.

7 years agolvconvert: reject changing number of stripes on single core
Heinz Mauelshagen [Tue, 30 May 2017 17:14:32 +0000 (19:14 +0200)]
lvconvert: reject changing number of stripes on single core

Reject any stripe adding/removing reshape on raid4/5/6/10 because
of related MD kernel deadlock on single core systems until
we get a proper fix in MD.

Related: rhbz1443999

This page took 0.069027 seconds and 5 git commands to generate.