]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agolvchange/vgchange/lvconvert: prevent raid4 creation/activation/conversion on non...
Heinz Mauelshagen [Thu, 27 Oct 2016 09:38:16 +0000 (11:38 +0200)]
lvchange/vgchange/lvconvert: prevent raid4 creation/activation/conversion on non-supporting raid targets

Check for dm-raid target version with non-standard raid4 mapping expecting the dedicated
parity device in the last rather than the first slot and prohibit to create, activate or
convert to such LVs from striped/raid0* or vice-versa in order to avoid data corruption.

Add related tests to lvconvert-raid-takeover.sh

Resolves: rhbz1388962

7 years agolvconvert: revert to only letting raid4 through to lv_raid_convert()
Heinz Mauelshagen [Wed, 26 Oct 2016 15:47:48 +0000 (17:47 +0200)]
lvconvert: revert to only letting raid4 through to lv_raid_convert()

Commit de78e8eae73c allowed to let any raid layout through
which we want to avoid until further validation cleanups.

Related to rhbz1386184

7 years agoraid_manip: fix typo
Heinz Mauelshagen [Wed, 26 Oct 2016 15:46:53 +0000 (17:46 +0200)]
raid_manip: fix typo

Related to rhbz1386184

7 years agodmsetup: remove stray '\n' in delete log message
Bryn M. Reeves [Mon, 24 Oct 2016 16:21:35 +0000 (17:21 +0100)]
dmsetup: remove stray '\n' in delete log message

7 years agodmsetup: obey --programid when deleting regions
Bryn M. Reeves [Mon, 24 Oct 2016 16:21:18 +0000 (17:21 +0100)]
dmsetup: obey --programid when deleting regions

7 years agolvconvert: position dedicated parity device in raid4 conversions porperly
Heinz Mauelshagen [Fri, 21 Oct 2016 16:59:59 +0000 (18:59 +0200)]
lvconvert: position dedicated parity device in raid4 conversions porperly

On conversions between striped/raid0* and raid4, the kernel expects
the dedicated raid4 parity SubLVs in the first segment area rather than
in the last it's been allocated to, thus the data mapping ain't proper.

Enhance lvconvert (lib/metadata/raid_manip.c) to shift the dedicated
parity SubLVs on conversions from striped/raid0* to raid4 and vice-versa.

In case of raid0_meta -> raid4 where the MD raid0 personality already has
stored RAID array device positions in the superblocks, the MetaLVs have to
be cleared so that the kernel doesn't fail validating the array positions
after lvm has shifted them up by one.

Add more tests to lvconvert-raid-takeover.sh including one to check for
mapping flaws by converting a created raid4 with filesystem -> striped
and fsck it.

Whilst on it:
- add missing direct striped -> raid4 conversion to the takeover array
  to avoid an intermim conversion from striped -> raid0*
- clean up the takeover array
- allow lvconvert to actually call lv_raid_convert() on all takeover requests
  in order to check parameters and display messages provided by takeover
  functions rather than just "...not supported" from within lvconvert
- fix a typo

Resolves: rhbz1386148

7 years agodmsetup: Produce partial output if dev disappears.
Alasdair G Kergon [Tue, 18 Oct 2016 17:01:52 +0000 (18:01 +0100)]
dmsetup: Produce partial output if dev disappears.

If a device disappears after obtaining the list of devices but before
processing it as a member of that list, dmsetup exits with a failure code.

Most commands still produce what output they can in these circumstances,
but 'ls --tree' and 'info -c' with fields depending on device dependencies
didn't.  Change this.

7 years agospec: move dmeventd -R from post to posttrans script for device-mapper-event package
Peter Rajnoha [Wed, 12 Oct 2016 11:50:22 +0000 (13:50 +0200)]
spec: move dmeventd -R from post to posttrans script for device-mapper-event package

See also https://bugzilla.redhat.com/show_bug.cgi?id=1382688.

7 years agolvconvert: still use strcmp for now
Zdenek Kabelac [Wed, 12 Oct 2016 09:12:48 +0000 (11:12 +0200)]
lvconvert: still use  strcmp for now

Keep for now function logic making its decision on string content.
We need bigger patch converting all things to bit-checks later.
This needs however bigger refactoring.
So this commit reverts some changes from:
c8b6c130158e1cc1a639afc21f5fd6306286fdb3

7 years agolvconvert: fix RAID SubLV --splitmirror regression
Heinz Mauelshagen [Tue, 11 Oct 2016 22:24:57 +0000 (00:24 +0200)]
lvconvert: fix RAID SubLV --splitmirror regression

Commit 088b3d036a73a7d947f6e9b12e8fad8a9f40d97f allowed repair on cache origin RAID LVs
and restricted lvconvert actions on RAID SubLVs to change number of mirrors, repair,
replace and type changes in order to avoid unsuitable coversions on them.

This introduced a regression prohibiting --splitmirrors on any RAID SubLVs
(e.g. of cache or thin LVs; lvconvert-{cache,thin}-raid.sh tests failing).

Fix allows split mirrors again.

Fix some indenting whilst on it.

7 years agolvmdbustest.py: ws fixes
Tony Asleson [Tue, 11 Oct 2016 17:22:31 +0000 (12:22 -0500)]
lvmdbustest.py: ws fixes

7 years agolvmdbustest.py: Add $PREFIX support
Tony Asleson [Tue, 11 Oct 2016 17:02:10 +0000 (12:02 -0500)]
lvmdbustest.py: Add $PREFIX support

Use the env variable PREFIX for vg & lv names

7 years agolvmdbustest.py: Use more compatible syntax
Tony Asleson [Tue, 11 Oct 2016 15:43:41 +0000 (10:43 -0500)]
lvmdbustest.py: Use more compatible syntax

7 years agolvmdbusd: Remove log ouput when ec=0 & stderr != 0 bytes
Tony Asleson [Tue, 11 Oct 2016 14:42:18 +0000 (09:42 -0500)]
lvmdbusd: Remove log ouput when ec=0 & stderr != 0 bytes

lvm likes to log to stderr virtually all the time, this isn't
helpful.

7 years agolvmdbusd: Disable lvm abort on too much log output
Tony Asleson [Tue, 11 Oct 2016 14:36:47 +0000 (09:36 -0500)]
lvmdbusd: Disable lvm abort on too much log output

The commit:
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=34c55d98eefd88f85476c0f62f0649c706bde6f0

introduced an abort if lvm logs too much.  In the case of utilizing
lvm shell this is a pretty normal occurance, so we will disable
when we use lvm shell.

7 years agotests: notify dbus only for dbus test
Zdenek Kabelac [Wed, 5 Oct 2016 09:48:03 +0000 (11:48 +0200)]
tests: notify dbus only for dbus test

7 years agocleanup: indent
Zdenek Kabelac [Tue, 11 Oct 2016 09:55:19 +0000 (11:55 +0200)]
cleanup: indent

7 years agocleanup: lvconvert drop unused variable
Zdenek Kabelac [Tue, 11 Oct 2016 09:52:07 +0000 (11:52 +0200)]
cleanup: lvconvert drop unused variable

7 years agocleanup: use already set values
Zdenek Kabelac [Tue, 11 Oct 2016 11:19:44 +0000 (13:19 +0200)]
cleanup: use already set values

When we have already decoded arg_is_set into a local var
or already set  segment type - already use these
values instead of repeating calls and string checks.

7 years agocleanup: reorder code
Zdenek Kabelac [Tue, 11 Oct 2016 09:56:15 +0000 (11:56 +0200)]
cleanup: reorder code

Move some arg test into a single place with sort of alphabetic order
when possible to make reading easier.

7 years agolvconvert: use _read_conversion_type
Zdenek Kabelac [Tue, 11 Oct 2016 11:19:12 +0000 (13:19 +0200)]
lvconvert: use _read_conversion_type

Code reodering and using same pattern for reading and validating arg
(--type in this case).

7 years agolvconvert: fix error value
Zdenek Kabelac [Tue, 11 Oct 2016 09:59:43 +0000 (11:59 +0200)]
lvconvert: fix error value

Seems some error path where not converted to 'new' ECMD return value.
Fix them to always 'goto out'.
Also drop unneeded   'ret = 0' when ret already is 0.

7 years agolvmdbustest.py: Add profile and path for lvm binary
Tony Asleson [Mon, 10 Oct 2016 21:26:38 +0000 (16:26 -0500)]
lvmdbustest.py: Add profile and path for lvm binary

7 years agolvmdbustest.py: Skip test_job_handling_timer on loopback
Tony Asleson [Fri, 7 Oct 2016 23:18:36 +0000 (18:18 -0500)]
lvmdbustest.py: Skip test_job_handling_timer on loopback

This test never passes on loop back, so we will skip unless the
pv devices are real devices which contain `/dev/sd`.

We always fail because we need lvm to run slow to get a timer to
pop, and loopback are too fast.

7 years agolvmdbustest.py: Denote failure if set_execution fails
Tony Asleson [Fri, 7 Oct 2016 20:30:18 +0000 (15:30 -0500)]
lvmdbustest.py: Denote failure if set_execution fails

7 years agolvmdbustest.py: Print to stderr
Tony Asleson [Fri, 7 Oct 2016 20:09:30 +0000 (15:09 -0500)]
lvmdbustest.py: Print to stderr

It's easier to follow if we print to stderr, so that our print messages
are in the lvm error log in the correct position to other printed
messages.

7 years agolvmdbustest.py: Ensure we exit non-zero on fail
Tony Asleson [Fri, 7 Oct 2016 19:55:36 +0000 (14:55 -0500)]
lvmdbustest.py: Ensure we exit non-zero on fail

If you run multiple runs of unittest.main, unless you don't pass exit=true
the test case always ends with a 0 exit code.  Add ability to store the
result of each invocation of the test and exit with a non-zero exit code
if anyone of them fail.

7 years agolvmdbusd: Ensure tmp dir gets cleaned up
Tony Asleson [Fri, 7 Oct 2016 18:46:59 +0000 (13:46 -0500)]
lvmdbusd: Ensure tmp dir gets cleaned up

Regardless of the outcome of starting up the lvm shell process, lets
ensure we clean up the temp directory and pipe.

7 years agolvmdbusd: Ensure lvm shell still exists
Tony Asleson [Fri, 7 Oct 2016 18:45:30 +0000 (13:45 -0500)]
lvmdbusd: Ensure lvm shell still exists

7 years agolvconvert: certain repair of cache raid volumes fails "Cannot convert internal LV"
Heinz Mauelshagen [Mon, 10 Oct 2016 15:29:40 +0000 (17:29 +0200)]
lvconvert: certain repair of cache raid volumes fails "Cannot convert internal LV"

In case a RAID orig LV is being cached and fails, repair is impossible because
"lvconvert --repair" gets rejected.

Fix by allowing repair on cache orig RAID LVs and
"lvconvert --replace/--mirrors/--type {raid*|mirror|striped|linear}" as well.

Allow the same lvconvert actions on any cache pool and metadata RAID SubLVs.

Resolves: rhbz1380532

7 years agolvmdbusd: Add LvCommon.DataPercent
Tony Asleson [Wed, 5 Oct 2016 20:51:48 +0000 (15:51 -0500)]
lvmdbusd: Add LvCommon.DataPercent

7 years agolvmdbusd: Add LvCommon.MovePv
Tony Asleson [Wed, 5 Oct 2016 20:28:42 +0000 (15:28 -0500)]
lvmdbusd: Add LvCommon.MovePv

Needed for feature parity for lvm2app.

7 years agolvmdbusd: Add properties to LvCommon
Tony Asleson [Wed, 5 Oct 2016 18:59:38 +0000 (13:59 -0500)]
lvmdbusd: Add properties to LvCommon

The following LvCommon properties were added so that the API
would have the same functionality as lvm2app has.

LvCommon.MetaDataSizeBytes
LvCommon.Attr
LvCommon.MetaDataPercent
LvCommon.CopyPercent
LvCommon.SnapPercent
LvCommon.SyncPercent

7 years agotoollib: clean up coverity issue
David Teigland [Tue, 4 Oct 2016 21:25:32 +0000 (16:25 -0500)]
toollib: clean up coverity issue

in processing duplicate pvs.

7 years agoRevert "cleanup: simplier assign of cmd vars"
Alasdair G Kergon [Mon, 3 Oct 2016 17:14:17 +0000 (18:14 +0100)]
Revert "cleanup: simplier assign of cmd vars"

This reverts commit cea441f4d1e19f170d9161203ef843c59f3fbf70.

cmd->default_values is configurable and this code should not make
any assumptions about values it holds.

7 years agotests: proper wait usage
Zdenek Kabelac [Thu, 29 Sep 2016 11:18:18 +0000 (13:18 +0200)]
tests: proper wait usage

Fix missing wait so we have paired waiting.
Also 'wait' for precise PID to get 'exit' code.

Test for 'error' replacing only with newer snapshot targets.
The old one will wait for resume.

Note: 'wait -n' is not always available so can't be used..

7 years agocleanup :drop unneeded header file
Zdenek Kabelac [Mon, 3 Oct 2016 12:49:06 +0000 (14:49 +0200)]
cleanup :drop unneeded header file

Not needed  (Coverity).

7 years agocleanup: drop test for NULL
Zdenek Kabelac [Mon, 3 Oct 2016 12:37:08 +0000 (14:37 +0200)]
cleanup: drop test for NULL

Since lp->segtype has been already checked for not-being NULL,
drop this test so Coverity is not later confused it 'can be a NULL'.

7 years agocleanup: drop assign before use
Zdenek Kabelac [Mon, 3 Oct 2016 11:04:16 +0000 (13:04 +0200)]
cleanup: drop assign before use

Drop unneeded assigns singe vars are set later in code before
their first use (Coverity).

7 years agocleanup: simplier assign of cmd vars
Zdenek Kabelac [Mon, 3 Oct 2016 11:00:50 +0000 (13:00 +0200)]
cleanup: simplier assign of cmd vars

Directly assign queried args as they provide matching values for
a setting.

7 years agodmeventd: pthread_sigmask in single function
Zdenek Kabelac [Mon, 3 Oct 2016 13:39:54 +0000 (15:39 +0200)]
dmeventd: pthread_sigmask in single function

Integrate back _unblock_sigalrm() and check for error code of
pthread_sigmask() function so we do not use uninitialized
sigmask_t on error path (Coverity).

7 years agolibdm: check for mem when _canonicalize_field_ids
Zdenek Kabelac [Mon, 3 Oct 2016 14:29:55 +0000 (16:29 +0200)]
libdm: check for mem when _canonicalize_field_ids

Add missing check for dm_pool_strdup() call (Coverity).

7 years agoraid: dmeventd plugin use 64bit arithmetic
Zdenek Kabelac [Mon, 3 Oct 2016 12:58:23 +0000 (14:58 +0200)]
raid: dmeventd plugin use 64bit arithmetic

Coverity suggested to used 64bit unsigned ints instead of signed 32b int.
Assuming there is no user of >31legs raid array.

7 years agolibdm: convert FIEMAP buffer allocation from stack to dm_zalloc
Bryn M. Reeves [Mon, 3 Oct 2016 13:42:30 +0000 (14:42 +0100)]
libdm: convert FIEMAP buffer allocation from stack to dm_zalloc

7 years agolvmlockd: fix segfault in error path
David Teigland [Wed, 28 Sep 2016 18:29:55 +0000 (13:29 -0500)]
lvmlockd: fix segfault in error path

The log_debug statement was ignoring the NULL vg error case.

7 years agolvmdbusd: Use 'pv_missing' column instead of '[unknown]'
Tony Asleson [Wed, 28 Sep 2016 16:18:10 +0000 (11:18 -0500)]
lvmdbusd: Use 'pv_missing' column instead of '[unknown]'

Previously using '[unknown]' for PV device path comparison which
is incorrect as it's not always true.

7 years agolvmdbusd: Remove extraneous parameter
Tony Asleson [Wed, 28 Sep 2016 16:16:49 +0000 (11:16 -0500)]
lvmdbusd: Remove extraneous parameter

Remove 'gen_new' parameter as it's not needed, correct documentation.

7 years agolvmdbusd: Add diagnostic validate for look ups
Tony Asleson [Tue, 27 Sep 2016 15:08:23 +0000 (10:08 -0500)]
lvmdbusd: Add diagnostic validate for look ups

Make sure that the lookup tables don't have extranoues stuff in
them.

7 years agolvmdbustest.py: Make sure to test for hidden lookups
Tony Asleson [Tue, 27 Sep 2016 03:03:12 +0000 (22:03 -0500)]
lvmdbustest.py: Make sure to test for hidden lookups

Test both vgname/[hidden] and vgname/hidden forms

7 years agolvmdbusd: Allow PV device names to be '[unknown]'
Tony Asleson [Tue, 27 Sep 2016 03:02:08 +0000 (22:02 -0500)]
lvmdbusd: Allow PV device names to be '[unknown]'

When a PV device is missing lvm will return '[unknown]' for the device
path.  The object manager keeps a hash table lookup for uuid and for PV's
device name.  When we had multiple PVs with the same device path we
we only had 1 key in the table for the lvm id (device path).  This caused
a problem when the PV device transitioned from '[unknown]' to known as any
subsequent transitions would cause an exception:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/lvmdbusd/request.py", line 66, in run_cmd
    result = self.method(*self.arguments)
  File "/usr/lib/python3.5/site-packages/lvmdbusd/manager.py", line 205, in _pv_scan
    cfg.load()
  File "/usr/lib/python3.5/site-packages/lvmdbusd/fetch.py", line 24, in load
    cache_refresh=False)[1]
  File "/usr/lib/python3.5/site-packages/lvmdbusd/pv.py", line 48, in load_pvs
    emit_signal, cache_refresh)
  File "/usr/lib/python3.5/site-packages/lvmdbusd/loader.py", line 80, in common
    cfg.om.remove_object(cfg.om.get_object_by_path(k), True)
  File "/usr/lib/python3.5/site-packages/lvmdbusd/objectmanager.py", line 153, in remove_object
    self._lookup_remove(path)
  File "/usr/lib/python3.5/site-packages/lvmdbusd/objectmanager.py", line 97, in _lookup_remove
    del self._id_to_object_path[lvm_id]
KeyError: '[unknown]'

when trying to delete a key that wasn't present.  In this case we don't add a
lookup key for the device path and the PV can only be located by UUID.

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

7 years agolvmdbusd: Clean up objectmanager.get_object_path_by_uuid_lvm_id
Tony Asleson [Tue, 27 Sep 2016 02:56:11 +0000 (21:56 -0500)]
lvmdbusd: Clean up objectmanager.get_object_path_by_uuid_lvm_id

This method grew crufty with a number of stuble bugs.  Refactor and
simplify.

7 years agolvmdbustest.py: Make env variable work
Tony Asleson [Tue, 27 Sep 2016 02:52:08 +0000 (21:52 -0500)]
lvmdbustest.py: Make env variable work

7 years agolvconvert: Disable thin pool raid conversion while active.
Alasdair G Kergon [Tue, 27 Sep 2016 17:22:54 +0000 (18:22 +0100)]
lvconvert: Disable thin pool raid conversion while active.

Works if the pool is inactive.

Activation code doesn't notice a new raid dependency in on-disk metadata
when a thin LV is already active.

https://bugzilla.redhat.com/1365286

7 years agolibdm: fix dm_stats_delete_region() backwards compat
Bryn M. Reeves [Tue, 27 Sep 2016 16:46:52 +0000 (17:46 +0100)]
libdm: fix dm_stats_delete_region() backwards compat

The dm_stats_delete_region() call removes a region from the bound
device, and, if the region is grouped, from the group leader
group descriptor stored in aux_data.

To do this requires a listed handle: previous versions of the
library do not since no dependencies exist between regions without
grouping.

This leads to strange behaviour when a command built against an old
version of the library is used with one supporting groups. Deleting
a region with dmstats succeeds, but logs errors:

  # dmstats list
  Name             RgID RgSta RgSiz #Areas ArSize ProgID
  vg_hex-root         0     0 1.00g      1  1.00g dmstats
  vg_hex-root         1 1.00g 1.00g      1  1.00g dmstats
  vg_hex-root         2 2.00g 1.00g      1  1.00g dmstats
  # dmstats delete --regionid 2 vg_hex/root
  Region ID 2 does not exist
  Could not delete statistics region.
  Command failed
  # dmstats list
  Name             RgID RgSta RgSiz #Areas ArSize ProgID
  vg_hex-root         0     0 1.00g      1  1.00g dmstats
  vg_hex-root         1 1.00g 1.00g      1  1.00g dmstats

This happens because the call to dm_stats_delete_region() is inside
a dm_stats_walk_*() iterator: upon entry to the call, the iterator
is at its end conditions and about to terminate. Due to the call to
dm_stats_list() inside the function, it returns with an iterator at
the beginning of a walk and performs a further iteration before
exiting. This final loop makes a further attempt to delete the
(already deleted) region, leading to the confusing error messages.

7 years agolibdm: fix stats walk compatibility with older dmsetup
Bryn M. Reeves [Tue, 27 Sep 2016 13:35:22 +0000 (14:35 +0100)]
libdm: fix stats walk compatibility with older dmsetup

The current dmsetup.c handles DR_STATS and DR_STATS_META reports
separately in _display_info_cols(), meaning that the stats walk
functions are never called for these report types.

Versions before v2.02.159 have a loop using dm_stats_walk_do() and
dm_stats_walk_while(), that executes once for non-stats reports,
and once per region, or area, for DR_STATS/DR_STATS_META reports.

This older behaviour relies on the documented behaviour that the
walk functions will accept a NULL pointer as the struct dm_stats*
argument.

This was broken by commit f1f2df7b: the NULL test on dms and
dms->regions were incorrectly moved from the dm_stats_walk_end()
wrapper to the internal '_stats_walk_end()' helper.

Since the pointer is dereferenced in between these points, using
an older dmsetup with current libdm results in a segfault when
running a non-stats report:

  # dmsetup info -c vg00/lvol0
  Segmentation fault (core dumped)

Restore the NULL checks to the wrapper function as intended.

7 years agosystemd: disable service start rate limiting for lvm2-pvscan@.service
Peter Rajnoha [Tue, 27 Sep 2016 08:47:54 +0000 (10:47 +0200)]
systemd: disable service start rate limiting for lvm2-pvscan@.service

We shouldn't be losing pvscans just because of the fact that the
underlying device (PV) appears and disappears quickly in the system,
otherwise lvmetad may not see the device if it appears again (or it may
still keep the device in cache even it's already gone).

7 years agopost-release
Alasdair G Kergon [Mon, 26 Sep 2016 13:29:35 +0000 (14:29 +0100)]
post-release

7 years agopre-release v2_02_166
Alasdair G Kergon [Mon, 26 Sep 2016 13:20:08 +0000 (14:20 +0100)]
pre-release

7 years agoman: fix dmsetup stats
Zdenek Kabelac [Mon, 26 Sep 2016 10:36:04 +0000 (12:36 +0200)]
man: fix dmsetup stats

Fix typo  STATS -> STATUS.

7 years agosystemd: fix extra space in unit generated by lvm2-activation-generator
Timur Bakeyev [Mon, 26 Sep 2016 07:54:19 +0000 (09:54 +0200)]
systemd: fix extra space in unit generated by lvm2-activation-generator

7 years agotoolcontext: read all configuration sources when checking config values in lvm2-activ...
Peter Rajnoha [Fri, 23 Sep 2016 12:51:15 +0000 (14:51 +0200)]
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).

7 years agomake: also clean up lvmdump.sh with substitutions - there's original lvmdump.sh.in
Peter Rajnoha [Fri, 23 Sep 2016 10:48:52 +0000 (12:48 +0200)]
make: also clean up lvmdump.sh with substitutions - there's original lvmdump.sh.in

7 years agotests: fix raid rebuild tests to work with older target versions
Heinz Mauelshagen [Thu, 22 Sep 2016 21:35:37 +0000 (23:35 +0200)]
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.

7 years agotests: raid repair needs devices in-sync
Zdenek Kabelac [Thu, 22 Sep 2016 13:46:18 +0000 (15:46 +0200)]
tests: raid repair needs devices in-sync

Though I'm not quite sure why we push this limit on user,
current --repair logic requires user to wait outside of command.

TODO: I'm not quite sure this repair logic is 'the most wanted'.

7 years agotests: check for TRIM support
Zdenek Kabelac [Thu, 22 Sep 2016 13:37:52 +0000 (15:37 +0200)]
tests: check for TRIM support

passdown can really work only on discardable device.
Skip 'status' test when PV does no support discard.

7 years agoconfig: use config_tree_from_string_without_dup_node_check throughout code to constru...
Peter Rajnoha [Wed, 21 Sep 2016 12:59:14 +0000 (14:59 +0200)]
config: use config_tree_from_string_without_dup_node_check throughout code to construct metadata trees

7 years agoconfig: add config_tree_from_string_without_dup_node_check to replace dm_config_from_...
Peter Rajnoha [Wed, 21 Sep 2016 12:42:16 +0000 (14:42 +0200)]
config: add config_tree_from_string_without_dup_node_check to replace dm_config_from_string where needed

7 years agoconfig: parse config tree without dup node checking if it's metadata tree
Peter Rajnoha [Wed, 21 Sep 2016 12:27:15 +0000 (14:27 +0200)]
config: parse config tree without dup node checking if it's metadata tree

7 years agolibdm: add dm_config_parse_without_dup_node_check
Peter Rajnoha [Wed, 21 Sep 2016 12:25:24 +0000 (14:25 +0200)]
libdm: add dm_config_parse_without_dup_node_check

Introduce function for config parsing tree without checking
for duplicate nodes.

7 years agocleanup: remove unused variables
Peter Rajnoha [Wed, 21 Sep 2016 13:53:50 +0000 (15:53 +0200)]
cleanup: remove unused variables

7 years agocoverity: dmsetup: fix possible use of uninitialized value
Peter Rajnoha [Wed, 21 Sep 2016 13:52:23 +0000 (15:52 +0200)]
coverity: dmsetup: fix possible use of uninitialized value

7 years agodmsetup: ensure --filemap histogram bounds are freed
Bryn M. Reeves [Wed, 14 Sep 2016 14:44:51 +0000 (15:44 +0100)]
dmsetup: ensure --filemap histogram bounds are freed

Make sure that the temporary dm_histogram used for the bounds
argument is freed in the case that the user provided a --bounds
argument on the command line.

7 years agolvconvert: fix (automatic) raid repair regression
Heinz Mauelshagen [Tue, 20 Sep 2016 22:38:38 +0000 (00:38 +0200)]
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

7 years agotests: correcting kernel version test
Zdenek Kabelac [Tue, 20 Sep 2016 20:50:43 +0000 (22:50 +0200)]
tests: correcting  kernel version test

Debug force leaked in.

7 years agotests: show some more device info
Zdenek Kabelac [Tue, 20 Sep 2016 20:47:14 +0000 (22:47 +0200)]
tests: show some more device info

When passdown is not there, look for possible reason.

7 years agotests: read messages instead of syslog
Zdenek Kabelac [Tue, 20 Sep 2016 20:36:29 +0000 (22:36 +0200)]
tests: read messages instead of syslog

Since on those older system there is rather 'fight' over
syslog reading buffer - lets read output from /var/log/messages
intead.

7 years agotests: kernel message for <3.5 kernels
Zdenek Kabelac [Tue, 20 Sep 2016 15:09:46 +0000 (17:09 +0200)]
tests: kernel message for <3.5 kernels

Since /dev/kmsg is useless on kernel <3.5 user there automatically
syslog to obtain traces from kernel log buffer during test.

7 years agocache: restore reported origin field
Zdenek Kabelac [Tue, 20 Sep 2016 12:26:11 +0000 (14:26 +0200)]
cache: restore reported origin field

Commit 199697accff0658a11420e263c1f85fb74cd39d3 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.

7 years agosnapshots: Fix monitoring to use cow not internal LV.
Alasdair G Kergon [Tue, 20 Sep 2016 01:30:58 +0000 (02:30 +0100)]
snapshots: Fix monitoring to use cow not internal LV.

7 years agolvmdbusd: Assign percentage on set
Tony Asleson [Mon, 19 Sep 2016 19:30:04 +0000 (14:30 -0500)]
lvmdbusd: Assign percentage on set

7 years agolvmdbustest: Remove pyudev deprecated warnings
Tony Asleson [Mon, 19 Sep 2016 15:33:32 +0000 (10:33 -0500)]
lvmdbustest: Remove pyudev deprecated warnings

7 years agolvmdbusd: Correct imports
Tony Asleson [Mon, 19 Sep 2016 15:29:26 +0000 (10:29 -0500)]
lvmdbusd: Correct imports

Place the imports in the files where they are directly needed.

7 years agolvmdbustest: ws fix-ups
Tony Asleson [Mon, 19 Sep 2016 15:20:12 +0000 (10:20 -0500)]
lvmdbustest: ws fix-ups

7 years agolvmdbusd: Fix dbus object with only properties and no method
Tony Asleson [Mon, 19 Sep 2016 14:54:24 +0000 (09:54 -0500)]
lvmdbusd: Fix dbus object with only properties and no method

Gris debugged that when we don't have a method the introspection
data is missing the interface itself eg.

<interface name="<your_obj_iface_name>" />

When adding the properties to the dbus object introspection we will
add the interface too if it's missing.  This now allows us the
ability to have a dbus object with only properties.

7 years agolvmdbustest.py: Test with/without timeout values
Tony Asleson [Sat, 17 Sep 2016 05:11:59 +0000 (00:11 -0500)]
lvmdbustest.py: Test with/without timeout values

Because of the different code paths we need to test job handling with
all operations.  Test now runs virtually everything with timeout == 0
and timeout == 15 so that we test both use cases.

Note:  If a client passes -1 for the timeout value they need to make
sure that their connection time out is also infinite.  Otherwise, if the client
times out the service side hangs any new dbus calls until the job
that is in progress completes.  Not sure why this behavior is occuring
at this time, but it appears a limitation/bug of the dbus-python library.

7 years agolvmdbusd: Set value to non none on error
Tony Asleson [Sat, 17 Sep 2016 05:10:46 +0000 (00:10 -0500)]
lvmdbusd: Set value to non none on error

When we register a failure we need to use a valid value which will be
returned with the object manager.  Otherwise we will raise an Exception
because we are trying to construct an object path from None.

7 years agolvmdbustest.py: Make methods static
Tony Asleson [Fri, 16 Sep 2016 19:01:18 +0000 (14:01 -0500)]
lvmdbustest.py: Make methods static

Changed methods to be static that should be.

7 years agolvmdbusd: Vg.LvCreate* methods, correct return type
Tony Asleson [Fri, 16 Sep 2016 19:00:14 +0000 (14:00 -0500)]
lvmdbusd: Vg.LvCreate* methods, correct return type

The methods were returning an instance of the object instead of the
object path which was causing an exception when the result was returned
with the job object as we are explicity trying to return an object path.

Unit test added which re-creates the issue and verifies the fix.

7 years agodebug: cleanup backtrace after log_error
Zdenek Kabelac [Fri, 16 Sep 2016 12:42:37 +0000 (14:42 +0200)]
debug: cleanup backtrace after log_error

7 years agodebug: mention origin_only in message
Zdenek Kabelac [Mon, 19 Sep 2016 11:48:54 +0000 (13:48 +0200)]
debug: mention origin_only in message

7 years agotests: enhance lvchange of thin pool tests
Zdenek Kabelac [Mon, 19 Sep 2016 11:49:32 +0000 (13:49 +0200)]
tests: enhance lvchange of thin pool tests

Validate also content of dmtable.
Check operations with unused thin-pool as well.

7 years agotests: check for metadata test working properly
Zdenek Kabelac [Fri, 16 Sep 2016 19:55:04 +0000 (21:55 +0200)]
tests: check for metadata test working properly

Add more tests to check they guard minimum free space in metadata
for new thin volume creation.

7 years agotests: add check grep_dmsetup
Zdenek Kabelac [Mon, 19 Sep 2016 11:46:42 +0000 (13:46 +0200)]
tests: add  check grep_dmsetup

Add simple helper/wrapper check function to check result
of dmsetup call i.e.:

check grep_dmsetup table vg-lv  "grep_expected"
check grep_dmsetup status vg-lv -v "grep_unexpected"

7 years agothin: fix lvchange of discards and zero flag
Zdenek Kabelac [Sat, 23 Apr 2016 19:09:09 +0000 (21:09 +0200)]
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()'.

7 years agothin: enforce there is some free space in thin pool metadata
Zdenek Kabelac [Fri, 16 Sep 2016 19:50:14 +0000 (21:50 +0200)]
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).

7 years agothin: report pool as holder when no active thin volume
Zdenek Kabelac [Fri, 16 Sep 2016 19:47:57 +0000 (21:47 +0200)]
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.

7 years agolibdm: fix end-of-groups test in _stats_walk_end()
Bryn M. Reeves [Fri, 16 Sep 2016 12:08:30 +0000 (13:08 +0100)]
libdm: fix end-of-groups test in _stats_walk_end()

7 years agoalloc: Use --alloc normal for mirror logs.
Alasdair G Kergon [Fri, 16 Sep 2016 01:11:58 +0000 (02:11 +0100)]
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

8 years agolvmdump: Use O_DIRECT to gather metadata.
Alasdair G Kergon [Thu, 15 Sep 2016 12:59:52 +0000 (13:59 +0100)]
lvmdump: Use O_DIRECT to gather metadata.

8 years agolvmlockd: fix metadata validation when rescanning VG
David Teigland [Tue, 13 Sep 2016 21:50:47 +0000 (16:50 -0500)]
lvmlockd: fix metadata validation when rescanning VG

When rescanning a VG from disk, the metadata read from
each PV was compared as a sanity check.  The comparison
is done by exporting the vg metadata from each dev to
a config tree, and then comparing the config trees.
The function to create the config tree inserts
extraneous information along with the actual VG metadata.
This extra info includes creation_time.  The config
trees for two devs can easily be created one second
apart in which case the different creation_times would
cause the metadata comparison to fail.  The fix is to
exclude the extraneous info from the metadata comparison.

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