]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agolvmdbusd: Make lvm shell read more robust
Tony Asleson [Tue, 29 Nov 2016 17:07:21 +0000 (11:07 -0600)]
lvmdbusd: Make lvm shell read more robust

Make sure JSON is correct before we stop trying to read.

7 years agotests: ensure there is dbus config file
Zdenek Kabelac [Fri, 25 Nov 2016 23:17:40 +0000 (00:17 +0100)]
tests: ensure there is dbus config file

Copy lvmdbusd.profile to lib as installed place.
Use  TESTOLDPWD and avoid add new 'same' variable test_data_dir.

7 years agomakefiles: drop file source and indent
Zdenek Kabelac [Fri, 25 Nov 2016 20:41:43 +0000 (21:41 +0100)]
makefiles: drop file source and indent

7 years agogcc: quiet warning about unused function
Zdenek Kabelac [Fri, 25 Nov 2016 14:02:36 +0000 (15:02 +0100)]
gcc: quiet warning about unused function

Once this function will need to be used, git revert.

7 years agocleanup: indent
Zdenek Kabelac [Fri, 25 Nov 2016 13:21:34 +0000 (14:21 +0100)]
cleanup: indent

7 years agocleanup: add missing WARNING into log_warn
Zdenek Kabelac [Fri, 25 Nov 2016 13:17:56 +0000 (14:17 +0100)]
cleanup: add missing WARNING into log_warn

7 years agocleanup: add some dots and use display_lvname
Zdenek Kabelac [Fri, 25 Nov 2016 13:08:39 +0000 (14:08 +0100)]
cleanup: add some dots and use display_lvname

Just some more VG/LV printing.

7 years agodebug: more stacktrace corrections
Zdenek Kabelac [Fri, 25 Nov 2016 12:46:06 +0000 (13:46 +0100)]
debug: more stacktrace corrections

Continue previous patch dropping some unneeded stack traces
after printed log_error/warn messages.

7 years agoscripts: fix comment about blk-availability init script
Peter Rajnoha [Fri, 25 Nov 2016 10:30:48 +0000 (11:30 +0100)]
scripts: fix comment about blk-availability init script

The original comment got there as copy-paste error and it wasn't edited
properly for blk-availability.

7 years agolvmdbusd: Only read whats buffered
Tony Asleson [Wed, 23 Nov 2016 20:49:23 +0000 (14:49 -0600)]
lvmdbusd: Only read whats buffered

When reading data from stdout & stderr we were reading until the
reading until we got None back which really isn't needed as the
read will return everything that is available.

7 years agodebug: stack tracing corrections
Zdenek Kabelac [Wed, 23 Nov 2016 09:30:52 +0000 (10:30 +0100)]
debug: stack tracing corrections

7 years agocleanup: indent changes
Zdenek Kabelac [Wed, 23 Nov 2016 09:48:33 +0000 (10:48 +0100)]
cleanup: indent changes

7 years agocleanup: defines
Zdenek Kabelac [Wed, 23 Nov 2016 09:54:06 +0000 (10:54 +0100)]
cleanup: defines

7 years agocleanup: use predefined macro for tmp image name
Zdenek Kabelac [Wed, 23 Nov 2016 09:39:59 +0000 (10:39 +0100)]
cleanup: use predefined macro for tmp image name

7 years agocleanup: deactivate has builtin check for active lv
Zdenek Kabelac [Wed, 23 Nov 2016 09:29:42 +0000 (10:29 +0100)]
cleanup: deactivate has builtin check for active lv

7 years agocleanup: add doc for raid status states
Zdenek Kabelac [Wed, 16 Nov 2016 14:29:09 +0000 (15:29 +0100)]
cleanup: add doc for raid status states

Show possible values for raid fields user may get ATM.

7 years agocleanup: single LVM_SYSTEM_DIR string
Zdenek Kabelac [Mon, 21 Nov 2016 13:54:20 +0000 (14:54 +0100)]
cleanup: single LVM_SYSTEM_DIR string

7 years agocleanup: hide gcc warning
Zdenek Kabelac [Wed, 16 Nov 2016 14:13:36 +0000 (15:13 +0100)]
cleanup: hide gcc warning

7 years agocleanup: use lv_update_and_reload
Zdenek Kabelac [Wed, 23 Nov 2016 09:57:36 +0000 (10:57 +0100)]
cleanup: use lv_update_and_reload

Avoid code duplication and use exiting commonly used
lv_update_and_reload() function.

There is still one place left where mirror is doing strange
double suspend call - needs there more thinking what's wrong with
that code.

7 years agocleanup: make this error an internal error
Zdenek Kabelac [Wed, 23 Nov 2016 16:15:10 +0000 (17:15 +0100)]
cleanup: make this error an internal error

We shouldn't get here with wrong type.

7 years agocleanup: use display_lvname and msg cleanup
Zdenek Kabelac [Wed, 16 Nov 2016 14:11:07 +0000 (15:11 +0100)]
cleanup: use display_lvname and msg cleanup

Use display_lvname in tracing messages.
Add some missing 'dots' to messages.

7 years agomirror: preserve MIRRORED status for temporara image
Zdenek Kabelac [Wed, 23 Nov 2016 16:11:26 +0000 (17:11 +0100)]
mirror: preserve MIRRORED status for temporara image

When lvconvert adds a new leg - it's doing it free 'temporary' image
layer - however this temporary 'internal' mirror is also MIRRORED LV.
But the status bit was not properly transfered through layer.

7 years agoraid: lvconvert uses transient check for raid
Zdenek Kabelac [Mon, 21 Nov 2016 13:54:51 +0000 (14:54 +0100)]
raid: lvconvert uses transient check for raid

Also check if the raid status isn't teling us there is something wrong
with any raid image device.

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

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