]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agoraid: implement transient status check
Zdenek Kabelac [Mon, 21 Nov 2016 11:43:18 +0000 (12:43 +0100)]
raid: implement transient status check

Take into acount reported state from 'raid' targets.
When raid leg is marked with 'D' - take it as missing leg.

7 years agoman: remove duplicate paragraph about selection criteria from lvm(8) man page
Peter Rajnoha [Tue, 22 Nov 2016 12:20:52 +0000 (13:20 +0100)]
man: remove duplicate paragraph about selection criteria from lvm(8) man page

The paragraph about selection criteria together with all the related
context is now documented in lvmreport(7) man page completely.

7 years agolvmdbusd: Remove extraneous finally
Tony Asleson [Thu, 17 Nov 2016 19:59:39 +0000 (13:59 -0600)]
lvmdbusd: Remove extraneous finally

The print statement is incorrect.

7 years agolvmdbusd: Fix source documentation
Tony Asleson [Thu, 17 Nov 2016 19:58:17 +0000 (13:58 -0600)]
lvmdbusd: Fix source documentation

7 years agolvmdbusd: cmdhandler.py, fix imports
Tony Asleson [Thu, 17 Nov 2016 19:57:44 +0000 (13:57 -0600)]
lvmdbusd: cmdhandler.py, fix imports

Use the correct py3 syntax for handling imports.  Also use print instead
of log_debug which in this context will produce no output.

7 years agolvmdbusd: Remove debug JSON file
Tony Asleson [Thu, 17 Nov 2016 17:45:11 +0000 (11:45 -0600)]
lvmdbusd: Remove debug JSON file

7 years agolvmdbustest: Reduce dbus object churn
Tony Asleson [Thu, 17 Nov 2016 16:34:07 +0000 (10:34 -0600)]
lvmdbustest: Reduce dbus object churn

Instead of creating a new dbus object each time we get an interface object
we will use the same one.

7 years agolvmdbustest: Move std_err_print to testlib
Tony Asleson [Thu, 17 Nov 2016 16:32:55 +0000 (10:32 -0600)]
lvmdbustest: Move std_err_print to testlib

So we can re-use it in the testlib too.

7 years agolvmdbusd: Place Manager.UseLvmShell request on queue
Tony Asleson [Wed, 16 Nov 2016 23:29:23 +0000 (17:29 -0600)]
lvmdbusd: Place Manager.UseLvmShell request on queue

We need to acquire a lock which can block us which in turn causes
the dbus request handling to block as well.  Place the request on
the work queue instead.

7 years agolvmdbusd: Extra report FD read on no data
Tony Asleson [Wed, 16 Nov 2016 21:57:04 +0000 (15:57 -0600)]
lvmdbusd: Extra report FD read on no data

Our expectation was that when using the lvm shell that when the lvm prompt
was read from stdout, that all other ouput had been written and flushed.
However, this doesn't appear to be the case.  Add extra read passes to
retrieve delayed report data.

7 years agolvmdbusd: Bubble up invalid JSON
Tony Asleson [Wed, 16 Nov 2016 21:45:05 +0000 (15:45 -0600)]
lvmdbusd: Bubble up invalid JSON

If we get invalid JSON, lets bubble that up to the user.

7 years agolvmdbustest.py: Reduce test client introspection calls
Tony Asleson [Wed, 16 Nov 2016 17:39:57 +0000 (11:39 -0600)]
lvmdbustest.py: Reduce test client introspection calls

The default dbus python library mode of operation is to leverage
introspection.  However, this introspection data isn't accessible
for users of the library and they have to specifically retrieve
the introspection data too. This resulted in many introspection
calls being made.  This change eliminates introspection calls if
we are testing multiple concurrent test clients.  If it's a single
client we will leverage a reduced amount of introspection data to
verify the introspection data is correct.  Typically clients don't
leverage introspection data nearly as much as this test client.

7 years agolvmdbusd: Remove un-used import
Tony Asleson [Wed, 16 Nov 2016 16:46:27 +0000 (10:46 -0600)]
lvmdbusd: Remove un-used import

7 years agolvmdbusd: WS corrections
Tony Asleson [Wed, 16 Nov 2016 16:46:09 +0000 (10:46 -0600)]
lvmdbusd: WS corrections

Fix mixed spaces & tabs and other ws issues.

7 years agolvmdbusd: Add cfg.load to pv remove
Tony Asleson [Wed, 16 Nov 2016 16:45:31 +0000 (10:45 -0600)]
lvmdbusd: Add cfg.load to pv remove

The global dbus state does not match lvm with simply removing the pv
dbus object.

7 years agolvmdbusd: _lv_create, simplify return path
Tony Asleson [Wed, 16 Nov 2016 16:44:04 +0000 (10:44 -0600)]
lvmdbusd: _lv_create, simplify return path

7 years agolvmdbustest.py: Support concurrent test runs
Tony Asleson [Fri, 11 Nov 2016 18:34:38 +0000 (12:34 -0600)]
lvmdbustest.py: Support concurrent test runs

The env variable LVM_DBUSD_PV_DEVICE_LIST when present and filled in
with at least 4 physical devices will run concurrently with other
instances running as long as they specify different devices in their
env variable.

When the env variable is not present the test runs as it did before.

7 years agolvmdbusd: Long running operations use own thread
Tony Asleson [Fri, 11 Nov 2016 15:46:12 +0000 (09:46 -0600)]
lvmdbusd: Long running operations use own thread

Anything that ends up using polld will be done in a unique thread
so that we don't hold off other operations from running concurrently.

7 years agolvmdbusd: Use one thread to fetch state updates
Tony Asleson [Thu, 10 Nov 2016 18:19:48 +0000 (12:19 -0600)]
lvmdbusd: Use one thread to fetch state updates

In preparation to have more than one thread issuing commands to lvm
at the same time we need to serialize updates to the dbus state and
retrieving the global lvm state.  To achieve this we have one thread
handling this with a thread safe queue taking and coalescing requests.

7 years agolvmdbus: Make bus name configurable
Tony Asleson [Fri, 4 Nov 2016 18:26:31 +0000 (13:26 -0500)]
lvmdbus: Make bus name configurable

Add env LVM_DBUS_NAME to change what the bus name is.

7 years agolvmdbustest.py: Remove raid4 use
Tony Asleson [Fri, 4 Nov 2016 18:16:24 +0000 (13:16 -0500)]
lvmdbustest.py: Remove raid4 use

Looks like this isn't support across versions.  Need to add functionality
to service to return the supported segment types, so we only use the
supported ones.

7 years agolibdm: separate dm_stats_populate() error cases
Bryn M. Reeves [Thu, 17 Nov 2016 11:39:43 +0000 (11:39 +0000)]
libdm: separate dm_stats_populate() error cases

There are two possible errors in _dm_stats_populate_region():

  * No region struct in dms->regions[region_id]
  * Failure to parse data from @stats_print

These have very different causes: the first occurs where a client
program is populating one region at a time (region_id is a single
region identifier), and has not previously called dm_stats_list()
to dimension the region tables; this is an API usage error.

The second occurs when either we read unparseable data from the
kernel (kernel bug), or where various resource allocations fail.

Separate these two cases out and log separate messages for each
(allocation failures in the path already have their own distinct
message), since the "failed to parse.." message in the un-listed
handle case is confusing and misleading.

7 years agoraid: Remove fixed FIXME
Alasdair G Kergon [Tue, 15 Nov 2016 20:45:55 +0000 (20:45 +0000)]
raid: Remove fixed FIXME

7 years agodbus: also recognize error state for missing service that comes from original D-Bus
Peter Rajnoha [Tue, 15 Nov 2016 09:09:11 +0000 (10:09 +0100)]
dbus: also recognize error state for missing service that comes from original D-Bus

7 years agodbus: only log msg as debug if lvm2-lvmdbusd unit missing for D-Bus notification
Peter Rajnoha [Mon, 14 Nov 2016 13:46:44 +0000 (14:46 +0100)]
dbus: only log msg as debug if lvm2-lvmdbusd unit missing for D-Bus notification

Do not emit warning message but only log debug message if
lvm2-lvmdbusd.service unit is missing and at the same time
we have global/notify_dbus=1 (which is used by default if we
configured sources with "--enable-notify-dbus"). We don't want
hard dependency between LVM2 and lvmdbusd so it's enough to log
only debug message in this case.

7 years agotests: fix checking for pvmove LV
Zdenek Kabelac [Mon, 14 Nov 2016 11:55:43 +0000 (12:55 +0100)]
tests: fix checking for pvmove LV

Use consitently egrep.

TODO: make probably aux func

7 years agocleanup: debug trace and indent change
Zdenek Kabelac [Tue, 8 Nov 2016 15:20:51 +0000 (16:20 +0100)]
cleanup: debug trace and indent change

7 years agocleanup: avoid using double __ in extracted image name
Zdenek Kabelac [Tue, 8 Nov 2016 15:21:25 +0000 (16:21 +0100)]
cleanup: avoid using double __ in extracted image name

7 years agocleanup: add dots to debug messages
Zdenek Kabelac [Fri, 11 Nov 2016 15:38:04 +0000 (16:38 +0100)]
cleanup: add dots to debug messages

7 years agotests: do not set zero interval in aux lvm.conf
Zdenek Kabelac [Fri, 11 Nov 2016 14:57:00 +0000 (15:57 +0100)]
tests: do not set zero interval in aux lvm.conf

0 interval leads as of now to a busy loop with lvmetad and command.

Avoid testing this patological case.

TODO: Code should possibly translate zero interval into some small
sleep. With lvmpolld it's already 1/10s

7 years agotests: avoid using polling
Zdenek Kabelac [Fri, 11 Nov 2016 14:56:11 +0000 (15:56 +0100)]
tests: avoid using polling

7 years agotests: update make targets
Zdenek Kabelac [Mon, 17 Oct 2016 09:13:43 +0000 (11:13 +0200)]
tests: update make targets

Add  new targets:

make check_lvmpolld
make check_cluster_lvmpolld
make check_lvmetad_lvmpolld
make check_all_lvmpolld

So check_lvmetad runs only base lvmetad test - to much
logic of remaining targets.

Previous behavior is available via  check_all_lvmpolld.

7 years agoconf: support zero for missing_stripe_filler
Zdenek Kabelac [Tue, 18 Oct 2016 10:58:22 +0000 (12:58 +0200)]
conf: support zero for missing_stripe_filler

Make it easier to replace missing segments with 'zero' returning
target - otherwise user would have to create some extra target
to provide zeros as /dev/zero can't be used (not a block device).

Also break code loop when segment is found and make it an INTERNAL_ERROR
where it's missing.

7 years agocleanup: skip checking for just assigned string
Zdenek Kabelac [Tue, 18 Oct 2016 09:18:02 +0000 (11:18 +0200)]
cleanup: skip checking for just assigned string

When 'stripe_filler' has been just set to 'error',
do not check it again for not being 'error'.

7 years agolvconvert: repair accepts interval and background
Zdenek Kabelac [Mon, 17 Oct 2016 09:16:16 +0000 (11:16 +0200)]
lvconvert: repair accepts interval and background

For mirror and raid we expose --interval and --background on
command line (instead of using just always using compiled-in defaults).

7 years agolvconvert: Introduce enum to separate cases.
Alasdair G Kergon [Fri, 11 Nov 2016 00:27:01 +0000 (00:27 +0000)]
lvconvert: Introduce enum to separate cases.

Start to separate out the different things that lvconvert does by using
an enum to identify 12 distinct cases.

7 years agodmsetup: [v2] return 0 for [--]{version,help}
Heinz Mauelshagen [Thu, 10 Nov 2016 17:09:37 +0000 (18:09 +0100)]
dmsetup: [v2] return 0 for [--]{version,help}

Leverage 0b1c79642061 to cope with "dmsetup SubCommand --{help,version}"
and bail out directly when _report_init() fails.

Related: rhbz1393692

7 years agodmsetup: return 0 for [--]{version,help}
Heinz Mauelshagen [Thu, 10 Nov 2016 16:03:04 +0000 (17:03 +0100)]
dmsetup: return 0 for [--]{version,help}

dmsetup regressed returning 1 when properly processing
version or help subcommands.

Resolves: rhbz1393692

7 years agotests: for repair we need neewer version
Zdenek Kabelac [Tue, 8 Nov 2016 10:15:25 +0000 (11:15 +0100)]
tests: for repair we need neewer version

Older cache targets were not able to report write failures.

7 years agotests: test raid0_meta type
Zdenek Kabelac [Mon, 7 Nov 2016 10:05:50 +0000 (11:05 +0100)]
tests: test raid0_meta type

Enable testing of raid0_meta type.
Also slow down devices a bit more.

7 years agoraid: faster rmeta clearing
Zdenek Kabelac [Tue, 8 Nov 2016 10:54:28 +0000 (11:54 +0100)]
raid: faster rmeta clearing

Instead of clearing multiple rmeta device with sequential activation
process and waiting for udev for every _rmeta device separately,
activate all _rmeta devices first and then clear them and deactivate
afterwards.

Also update some tracing messages.

When anyhing goes wrong during clearing process, always try to
deactivate as much _rmeta devices as possible before fail.

7 years agopost-release
Alasdair G Kergon [Sat, 5 Nov 2016 01:14:06 +0000 (01:14 +0000)]
post-release

7 years agopre-release v2_02_167
Alasdair G Kergon [Sat, 5 Nov 2016 01:03:32 +0000 (01:03 +0000)]
pre-release

7 years agotests: Disable 3-leg raid1 pre-sync repair attempt
Alasdair G Kergon [Fri, 4 Nov 2016 00:23:08 +0000 (00:23 +0000)]
tests: Disable 3-leg raid1 pre-sync repair attempt

Test fails as it doesn't ensure device isn't already in sync.

7 years agolvmdbusd: Remove the periodic timer task
Tony Asleson [Thu, 3 Nov 2016 23:27:22 +0000 (18:27 -0500)]
lvmdbusd: Remove the periodic timer task

This code is no longer needed because the back ground task has been
removed.  Will add back if we change the design and end up utilizing
multiple worker threads.

7 years agolvmdbusd: Take out background thread
Tony Asleson [Thu, 3 Nov 2016 23:25:12 +0000 (18:25 -0500)]
lvmdbusd: Take out background thread

There is no reason to create another background task when the task that
created it is going to block waiting for it to finish.  Instead we will
just execute the logic in the worker thread that is servicing the worker
queue.

7 years agodmeventd: provide message context
Zdenek Kabelac [Wed, 26 Oct 2016 10:13:34 +0000 (12:13 +0200)]
dmeventd: provide message context

Show device name with printed message.
Also use different level for printing error message and
standard informational message.

7 years agocleanup: use WARNING prefix for log_warn
Zdenek Kabelac [Wed, 26 Oct 2016 12:42:13 +0000 (14:42 +0200)]
cleanup: use WARNING prefix for log_warn

Use capital WARNING prefix for log_warn() messages.

7 years agocleanup: remove goto
Zdenek Kabelac [Wed, 26 Oct 2016 09:26:02 +0000 (11:26 +0200)]
cleanup: remove goto

Move goto path into 'if()' branch.

7 years agolog_info to log_very_verbose
Zdenek Kabelac [Tue, 1 Nov 2016 10:02:01 +0000 (11:02 +0100)]
log_info to log_very_verbose

Translate log_info() into log_very_verbose() which is macro
supposed to be used by our code.

log_info() is internal macro with eventually some 'symbolic' meaning
in syslogging daemons.

7 years agolog_info to log_warn
Zdenek Kabelac [Mon, 31 Oct 2016 17:00:53 +0000 (18:00 +0100)]
log_info to log_warn

Switch to log_warn level when we are reporting these message.

7 years agocleanup: log_info to log_error
Zdenek Kabelac [Mon, 31 Oct 2016 17:03:06 +0000 (18:03 +0100)]
cleanup: log_info to log_error

Switch to more appropriate logging level.

7 years agolibdm: use dm_log_with_errno always
Zdenek Kabelac [Thu, 3 Nov 2016 16:15:07 +0000 (17:15 +0100)]
libdm: use dm_log_with_errno always

Instead of compiling 2 log call for 2 different logging functions,
and runtime decide which version to use - use only 'newer' function
and when user sets his own OLD dm_log logging translate it runtime
for old arg list set.

The positive part is - we get shorter generated library,
on the negative part this translation means, we always have evaluate
all args and print the message into local on stack buffer, before
we can pass this buffer to the users' logging function with proper
expected parameters (and such function may later decide to discard
logging based on message level so whole printing was unnecessary).

7 years agotests: check that pvscan cannot activate exported VG
David Teigland [Thu, 3 Nov 2016 16:43:08 +0000 (11:43 -0500)]
tests: check that pvscan cannot activate exported VG

7 years agocleanup: add 'static' for local struct
Zdenek Kabelac [Wed, 2 Nov 2016 13:26:41 +0000 (14:26 +0100)]
cleanup: add 'static' for local struct

7 years agocleanup: drop unused attribute
Zdenek Kabelac [Wed, 2 Nov 2016 09:55:19 +0000 (10:55 +0100)]
cleanup: drop unused attribute

In this function we pass args through so make the function
header look the same as with _default_log().

7 years agodmeventd: separate dm and dmeventd logging
Zdenek Kabelac [Thu, 3 Nov 2016 11:10:45 +0000 (12:10 +0100)]
dmeventd: separate dm and dmeventd logging

Ensure different logging function for dmeventd.c logging
and dm and lvm library.

We can recognize we want to show every log_info() and
log_notice() message from dmeventd.c code while not
exposing those from libdm/libdevmapper-event

Also switch to use log with errno - it's not changing
anything and doesn't bring any more features yet to dmeventd
logging but we just properly pass dm_errno_or_class properly
through the whole code stack for possible future use
(i.e. support of class logging for dmeventd).

7 years agodmeventd: debug only subsystemd with # sign
Zdenek Kabelac [Thu, 3 Nov 2016 11:01:01 +0000 (12:01 +0100)]
dmeventd: debug only subsystemd with # sign

Reword the logging logic and try to restore previous logging
behavior for 'standalone' running daemon while preserving
debuggable feautures it has gained.

So actual rules:

dmeventd without any '-d' option will syslog all messages
from dmeventd.c it dmeventd plugins.

log_notice()==log_verbose()
log_info()==log_very_verbose()
But to show also log_debug() used has to give '-ddd'.

When user specified '-d, -dd, -ddd, -dddd' it
will also enable tracing of messages from libdm & lib
executed code - which is mainly useful for testing
i.e.: 'dmeventd -fldddd'

7 years agodmeventd: abort on internal error
Zdenek Kabelac [Wed, 2 Nov 2016 13:40:12 +0000 (14:40 +0100)]
dmeventd: abort on internal error

Provide same support for DM_ABORT_ON_INTERNAL_ERRORS we do have
with default libdm logging  as  dmeventd is libdm based tool.

7 years agolibdm: report logging with errno as changed default
Zdenek Kabelac [Thu, 3 Nov 2016 11:07:27 +0000 (12:07 +0100)]
libdm: report logging with errno as changed default

When user changes logging with 'dm_log_with_errno_init()'
also report this as non default dm logging.

7 years agologging: add more log macros
Zdenek Kabelac [Wed, 2 Nov 2016 13:39:13 +0000 (14:39 +0100)]
logging: add more log macros

Introduce macros:

log_level(), log_stderr(), log_once(), log_bypass_report()

For easier and more consisten way how to 'decoder' bits
of info from passed 'level'.

This patch fixes potential problem when 'level' of message
might not have always masked right bits.

7 years agolvmdbusd: Stop using threads for job wait
Tony Asleson [Wed, 2 Nov 2016 19:14:56 +0000 (14:14 -0500)]
lvmdbusd: Stop using threads for job wait

Instead of creating a thread to handle the case where a client
is calling job.Wait, we will utilize a timer.  This significantly
reduces the number of threads that get created and destroyed while
the service is running.

7 years agolvmdbusd: main.py: change debug msg text
Tony Asleson [Tue, 1 Nov 2016 22:52:51 +0000 (17:52 -0500)]
lvmdbusd: main.py: change debug msg text

7 years agolvmdbusd: Don't use dbus lib in worker thread
Tony Asleson [Tue, 1 Nov 2016 22:52:18 +0000 (17:52 -0500)]
lvmdbusd: Don't use dbus lib in worker thread

Simplify the code paths so that we don't utilize the dbus library code
when we are in worker thread context.

ref. https://bugs.freedesktop.org/show_bug.cgi?id=98521

7 years agolvmdbusd: Execute load in main thread
Tony Asleson [Tue, 1 Nov 2016 22:50:10 +0000 (17:50 -0500)]
lvmdbusd: Execute load in main thread

We will fetch the lvm state in non-main thread and only process the new
data with the main thread to prevent hanging the main thread event loop.

ref. https://bugs.freedesktop.org/show_bug.cgi?id=98521

7 years agolvmdbusd: Return results in main thread
Tony Asleson [Tue, 1 Nov 2016 22:48:39 +0000 (17:48 -0500)]
lvmdbusd: Return results in main thread

Also introduce some additional new code to execute code other code
in main thread too.

ref. https://bugs.freedesktop.org/show_bug.cgi?id=98521

7 years agolvmdbusd: Use timer instead of thread
Tony Asleson [Tue, 1 Nov 2016 22:42:14 +0000 (17:42 -0500)]
lvmdbusd: Use timer instead of thread

We had a thread sitting around for cleaning up other processes, changed to
a periodic timer task.

7 years agopvscan: fix autoactivation of exported VG
David Teigland [Wed, 2 Nov 2016 21:29:52 +0000 (16:29 -0500)]
pvscan: fix autoactivation of exported VG

pvscan --cache -aay was activating LVs in exported VGs
when it should not.

It appears that this was a regression from commit 9b640c36841
"pvscan: use process_each_vg for autoactivate".

7 years agoblkdeactivate: deactivate dev stack if dev on top already unmounted
Peter Rajnoha [Tue, 1 Nov 2016 15:41:30 +0000 (16:41 +0100)]
blkdeactivate: deactivate dev stack if dev on top already unmounted

If blkdeactivate finds out that the device on top of device stack
is already unmounted, it still proceeds with device stack deactivation
underneath now.

This situation can happen if blkdeactivate is started and the mount
point is unmounted in parallel by chance (so when blkdeactivate
gets the the actual umount call, the device is not mounted anymore).
Before, the blkdeactivate added such device to skip list which caused
all the stack underneath to be skipped too on deactivation. Now, we
proceed just as if blkdeactivate did the umount itself.

For example, in the example below, the vg-lvol0 is mounted on /mnt/test
when blkdeactivate is called, but it gets unmounted in parallel later
on when blkdeactivate gets to the actual umount call.

Before this patch (vg-lvol0 underneath not deactivated):

  $ blkdeactivate -u
  Deactivating block devices:
    [UMOUNT]: unmounting vg-lvol0 (dm-2) mounted on /mnt/test... skipping

With this patch applied (vg-lvol0 underneath still deactivated):

  $ blkdeactivate -u
  Deactivating block devices:
    [UMOUNT]: unmounting vg-lvol0 (dm-2) mounted on /mnt/test... already unmounted
    [LVM]: deactivating Logical Volume vg/lvol0... done

7 years agotest: add raid4 checks to respective tests
Heinz Mauelshagen [Fri, 28 Oct 2016 19:54:10 +0000 (21:54 +0200)]
test: add raid4 checks to respective tests

Add missing checks for valid raid4 mapping to tests.

7 years agolvconvert: fix raid repair regression
Heinz Mauelshagen [Fri, 28 Oct 2016 19:45:00 +0000 (21:45 +0200)]
lvconvert: fix raid repair regression

Limit prevention to raid1 as intended with commit 8270ff5702e0.

Related to rhbz1311765

7 years agolvconvert: prevent non-synced raid1 primary leg repair
Heinz Mauelshagen [Fri, 28 Oct 2016 13:54:27 +0000 (15:54 +0200)]
lvconvert: prevent non-synced raid1 primary leg repair

(Automatic) repair may not be allowed during the initial sync of an upconverted
linear LV, because the data on the failing, primary leg hasn't been completely
synchronized to the N-1 other legs of the raid1 LV (replacing failed legs during
repair involves discontinuing access to any replaced legs data, thus preventing
data recovery on the primary leg e.g. via dd_rescue).

Even though repair would not cause data loss when adding legs to a fully synced
raid1 LV, we don't have information yet defining this state yet (e.g. a raid1
LV flag telling the fully synchronized status before any legs were added),
hence can't automatically decide to allow to repair.

If nonetheless a repair on a non-synced raid1 LVs is intended, the "--force"
option has to be provided.

Resolves: rhbz1311765

7 years agolvconvert: check for supported raid0/raid4 segtypes
Heinz Mauelshagen [Thu, 27 Oct 2016 14:44:32 +0000 (16:44 +0200)]
lvconvert: check for supported raid0/raid4 segtypes

Validate kernel support for raid0/raid4 on given and
requested segtype before requesting conversions on them.

Because raid10 wasn't present in old RAID targets, add
the same validation to be prepared once we support them.

7 years agolvconvert-raid-takeover.sh: fix test
Heinz Mauelshagen [Thu, 27 Oct 2016 14:38:15 +0000 (16:38 +0200)]
lvconvert-raid-takeover.sh: fix test

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.

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