1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00
Commit Graph

3762 Commits

Author SHA1 Message Date
Alasdair G Kergon
5233a3468c pre-release 2016-09-26 14:20:08 +01:00
Peter Rajnoha
b5e093624d toolcontext: read all configuration sources when checking config values in lvm2-activation-generator through lighweight toolcontext handler
We added lightweight toolcontext handle to avoid useless initialization
of some parts of the context and also to avoid problems when using the
handle very soon at system boot, like in lvm2-activation-generator
through lvm2app interface. However, we missed reading all the other
config sources like lvmlocal.conf as well as any tag config - we need to
read these too to get the final config value which may be overriden in
any of these additional config sources.

Currently, we use this lightweight toolcontext handle to read
global/use_lvmetad and global/use_lvmpolld config values in
lvm2-activation-generator using lvm2app interface (lvm_config_find_bool
lvm2app function).
2016-09-23 14:57:44 +02:00
Heinz Mauelshagen
f2efd04052 tests: fix raid rebuild tests to work with older target versions
Pre 1.9 dm-raid targets status output was racy, which caused
the device status chars to be unreliable _during_ synchronization.
This shows paritcularly with tiny test devices used.

Enhance lvchange-rebuild-raid.sh to not check status
chars _during_ synchronization. Just check afterwards.
2016-09-22 23:35:37 +02:00
Peter Rajnoha
f1cad4c710 config: use config_tree_from_string_without_dup_node_check throughout code to construct metadata trees 2016-09-21 18:18:15 +02:00
Heinz Mauelshagen
5d455b28fc lvconvert: fix (automatic) raid repair regression
The dm-raid target now rejects device rebuild requests during ongoing
resynchronization thus causing 'lvconvert --repair ...' to fail with
a kernel error message. This regresses with respect to failing automatic
repair via the dmeventd RAID plugin in case raid_fault_policy="allocate"
is configured in lvm.conf as well.

Previously allowing such repair request required cancelling the
resynchronization of any still accessible DataLVs, hence reasoning
potential data loss.

Patch allows the resynchronization of still accessible DataLVs to
finish up by rejecting any 'lvconvert --repair ...'.

It enhances the dmeventd RAID plugin to be able to automatically repair
by postponing the repair after synchronization ended.

More tests are added to lvconvert-rebuild-raid.sh to cover single
and multiple DataLV failure cases for the different RAID levels.

- resolves: rhbz1371717
2016-09-21 00:39:29 +02:00
Zdenek Kabelac
67d4b3b7f2 cache: restore reported origin field
Commit 199697accf rerouted funtion
for priting cache volume origin to lvm2app app function - which
however had a bug.  So restore the original functionality
and print correct LV as cache origin LV.
2016-09-20 14:26:11 +02:00
Alasdair G Kergon
414d39085c snapshots: Fix monitoring to use cow not internal LV. 2016-09-20 02:30:58 +01:00
Zdenek Kabelac
0e8449a5b9 thin: fix lvchange of discards and zero flag
Reload of thin-pool origin_only is designed to only post messages
to a thin-pool. It's not intended to be used for reload of thin-pool
table. Fix it by using standard call  'lv_update_and_reload()'.
2016-09-19 14:00:56 +02:00
Zdenek Kabelac
c2c2721d00 thin: enforce there is some free space in thin pool metadata
Unconditionally guard there is at least 1/4 of metadata volume
free (<16Mib) or 4MiB - whichever value is smaller.

In case there is not enough free space do not let operation proceed and
recommend thin-pool metadata resize (in case user has not
enabled autoresize, manual 'lvextend --poolmetadatasize' is needed).
2016-09-19 14:00:56 +02:00
Zdenek Kabelac
776d5a25b4 thin: report pool as holder when no active thin volume
In the case there is no active thin volume, report thin pool
as lock holder. This fixed function like lvextend
which either expecte lock holder LV is some active thin
or 'possibly' inactive thin pool.
2016-09-19 14:00:56 +02:00
Alasdair G Kergon
9c8c8fb63a alloc: Use --alloc normal for mirror logs.
The existing code doesn't understand that mirror logs should cling to
parallel LVs (like extending them) instead of avoiding them.

As a quick workaround to avoid lvcreate failures, hard-code
--alloc normal for mirror logs even if the rest of the allocation
used a stricter policy.

https://bugzilla.redhat.com/show_bug.cgi?id=1376532
2016-09-16 02:11:58 +01:00
Alasdair G Kergon
5da35d879a lvmdump: Use O_DIRECT to gather metadata. 2016-09-15 14:00:39 +01:00
Zdenek Kabelac
b592ea5bbc activation: dso always defined for monitoring query
Ensure 'dso' has always a defined (NULL) value,
and also ensure NULL 'dso' is not dereferenced.
2016-09-12 16:49:49 +02:00
Peter Rajnoha
06c7220f78 man: add lvmreport man page 2016-09-12 14:11:39 +02:00
Alasdair G Kergon
1768ca599b man: Only install lvmraid when needed. 2016-09-12 13:03:09 +01:00
Zdenek Kabelac
454b891f6d cache: fix reporting of dirty cache
When cache has zero used blocks it's been wrongly reported as 100.00% dirty.
Fix it and report 0.00.
2016-09-09 20:53:36 +02:00
Zdenek Kabelac
9350aa7218 lvm2app: fix cache percantage reporting
In lvm2app we were always returning dirty (copy%) value.
Return properly data & metadata usage values.
2016-09-09 15:03:28 +02:00
Zdenek Kabelac
4b22cd81e6 cache: report metadata percentage
Reinstantiate reporting of metadata percent usage for cache volumes.
Also show the same percentage with hidden cache-pool LV.
This regression was caused by optimization for a single-ioctl in
2.02.155.
2016-09-09 15:01:35 +02:00
Brassow Jonathan
5838c41a35 cache: scrubbing for cache origin LV - Bug 1169495
Allow RAID scrubbing on cache origin sub-LV

This patch adds the ability to perform RAID scrubbing on the cache
origin sub-LV (https://bugzilla.redhat.com/1169495).  Cache origin
operations are restricted to non-clustered RAID LVs until there can
be further testing in a cluster (even for exclusive activation).

User can either specify directly _corig LV
or he can specify cache LV and operation  --syncation is
passed ONLY to   _corig LV.

If users wants to manipulation with cache-pool devices - he
needs to specify this object name.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2016-09-07 16:42:32 +02:00
Alasdair G Kergon
01cc0dfae9 post-release 2016-09-07 02:34:15 +01:00
Alasdair G Kergon
3d2b1ff5c4 pre-release 2016-09-07 02:25:51 +01:00
Peter Rajnoha
5d323c37f3 refactor: move and rename _dev_is_mpath_component in lvmetad.c to udev_dev_is_mpath_component in dev-type.c 2016-09-05 12:55:25 +02:00
Peter Rajnoha
16ed726610 lvmdump: use lsblk -s and lsblk -O in lvmdump only if these options are supported
The lsblk is just a nice helper here - it's not crucial for lvmdump so
do best effort here and use the most we can from current version of
lsblk that is installed on system. The lsblk -s option was added a bit
later after lsblk introduction and lsblk -O support even more later -
so if these are not available, use only pure lsblk output without any
extras.
2016-08-30 15:38:34 +02:00
Alasdair G Kergon
be85c22f65 raid10: Fix #stripes in lvcreate msg when too many. 2016-08-30 12:04:23 +01:00
Zdenek Kabelac
81970d22d8 cache: do not monitor cache-pool
Avoid monitoring of activated cache-pool - where the only purpose ATM
is to clear metadata volume which is actually activate in place
of cache-pool name (using public LV name).

Since VG lock is held across whole clear operation, dmeventd cannot
be used anyway - however in case of appliction crash we may
leave unmonitored device.

In future we may provide better mechanism as the current name
replacemnet is creating 'uncommon' table setups in case the metadata
LV is more complex type like raid  (needs some futher thinking about
error path results).

Another point to think about is the fact we should not clear device
while holding lock (i.e. dmeventd mirror repair cannot work in cases
like this).
2016-08-29 20:51:15 +02:00
Zdenek Kabelac
b493811968 cache: introduce cache_pool_max_chunks
Introduce 'hard limit' for max number of cache chunks.
When cache target operates with too many chunks (>10e6).

When user is aware of related possible troubles he
may increase the limit in lvm.conf.

Also verbosely inform user about possible solution.

Code works for both lvcreate and lvconvert.

Lvconvert fully supports change of chunk_size when caching LV
(and validates for compatible settings).
2016-08-29 20:47:31 +02:00
Alasdair G Kergon
2fde4399a0 lvconvert: Fix --splitmirrors segfault with incorrect PV.
Commit 9ee071705b misunderstood integer
promotion, but it's simpler to detect -1 more directly.
2016-08-26 01:21:01 +01:00
Peter Rajnoha
e758d722c7 conf: fix typo in report/columns_as_rows config option name recognition
Commit e947c362dd introduced
config_settings.h file for central place to store all definitions for
config options. By mistake, it used report/colums_as_rows instead
of report/columns_as_rows (missing "n" in "columns").
2016-08-25 14:53:32 +02:00
Alasdair G Kergon
7ba7768111 alloc: Avoid PV tags too when avoiding parallel PV allocation.
Also add debug messages for parallel PVs.
2016-08-24 19:41:11 +01:00
Alasdair G Kergon
68adf2c199 alloc: Move _log_parallel_areas. 2016-08-24 15:47:38 +01:00
Alasdair G Kergon
7837fbc1c1 lvconvert: Disallow raid10 mirror conversions. 2016-08-23 23:40:16 +01:00
Alasdair G Kergon
952e413328 dmeventd: Fix unmonitoring when segtype changes.
When the segment type is being changed, unmonitoring an LV requires
the existing dso to be specified as a parameter, not the new one.
2016-08-23 02:26:14 +01:00
Alasdair G Kergon
7646741ec6 raid: Don't monitor raid0 or raid0_meta LVs. 2016-08-20 02:14:33 +01:00
Alasdair G Kergon
88e6abc5a0 lvconvert: Don't allow --repair on raid0 LVs. 2016-08-19 23:42:01 +01:00
Alasdair G Kergon
ea0f604e70 lvcreate: No longer adjust --stripes for raid types.
If the number of stripes requested is incompatible with the requested
type of raid, give an error instead of adjusting it.

If no stripes argument is supplied, continue to use an appropriate
default.
2016-08-19 14:19:51 +01:00
Alasdair G Kergon
c27963c566 lib: Move lcm and gcd to lib/misc for wider use. 2016-08-18 14:06:13 +01:00
Alasdair G Kergon
114db6f745 tools: Suppress some unnecessary --stripesize warnings.
https://bugzilla.redhat.com/1366745
2016-08-15 19:38:45 +01:00
Heinz Mauelshagen
8e9d5d12ae pvmove: prohibit non-resilient collocation of RAID SubLVs
'pvmove -n name pv1 pv2' allows to collocate multiple RAID SubLVs
on pv2 (e.g. results in collocated raidlv_rimage_0 and raidlv_rimage_1),
thus causing loss of resilence and/or performance of the RaidLV.

Fix this pvmove flaw leading to potential data loss in case of PV failure
by preventing any SubLVs from collocation on any PVs of the RaidLV.
Still allow to collocate any DataLVs of a RaidLV with their sibling MetaLVs
and vice-versa though (e.g. raidlv_rmeta_0 on pv1 may still be moved to pv2
already holding raidlv_rimage_0).

Because access to the top-level RaidLV name is needed,
promote local _top_level_lv_name() from raid_manip.c
to global top_level_lv_name().

- resolves rhbz1202497
2016-08-15 18:22:32 +02:00
Alasdair G Kergon
c7bd33d951 post-release 2016-08-15 13:23:06 +01:00
Alasdair G Kergon
8297276967 pre-release 2016-08-15 13:17:47 +01:00
Alasdair G Kergon
93b61c07eb raid: Avoid double suffix on rmeta LV name paired with rimage LV. 2016-08-11 23:31:49 +01:00
Alasdair G Kergon
480c1c9599 post-release 2016-08-10 03:01:55 +01:00
Alasdair G Kergon
37b8b84fee pre-release 2016-08-10 02:42:35 +01:00
Heinz Mauelshagen
6f90c954b7 WHATS_NEW: reject --nosync option for RAID6 LVs in lvcreate 2016-08-08 16:00:49 +02:00
Alasdair G Kergon
c55134aa48 lvconvert: Limit --corelog and --mirrorlog to mirrors.
It's an error to specify a log when the final result is not of type
mirror.
2016-08-08 14:39:55 +01:00
Peter Rajnoha
57fa5d4329 lvmcmdline: do not refresh whole cmd context if profile dropped after processing LVM cmd
We don't need to refresh whole cmd context if we drop profile after
processing LVM command - just like we don't refresh cmd context when
we're applying the profile. It's because profiles contain only safe
subset of settings which do not require complete cmd context refresh.

This patch calls process_profilable_config instead of
refresh_toolcontext if there was profile applied for the LVM
command only, not --config which requires toolcontext refresh.
The process_profilable_config just sets proper values based on
values of profilable settings, but it does not do complete
reinitialization of various parts (e.g. filters, logging etc.).
2016-08-08 11:57:13 +02:00
Alasdair G Kergon
76ef2d15d8 lvconvert: Support raid0<->raid4 and mirror<->raid1.
Only simple takeover cases so far.
2016-08-07 00:56:08 +01:00
Alasdair G Kergon
de7f1deb80 raid: Report supported lvconvert conversions if invalid. 2016-08-07 00:30:26 +01:00
Heinz Mauelshagen
802bd34562 WHATS_NEW: fixup order 2016-08-05 16:31:46 +02:00
Heinz Mauelshagen
9aefe9aa7a WHATS_NEW: add '--rebuild PV' option to lvchange to allow for PV selective rebuilds 2016-08-05 16:07:14 +02:00