]> sourceware.org Git - lvm2.git/log
lvm2.git
6 years agocleanup: use path on stack
Zdenek Kabelac [Fri, 9 Mar 2018 11:59:13 +0000 (12:59 +0100)]
cleanup: use path on stack

6 years agoraid: skip frozen raid devices
Zdenek Kabelac [Thu, 8 Mar 2018 12:18:39 +0000 (13:18 +0100)]
raid: skip frozen raid devices

Some kernel version suffer from bad state transition where a device
steps into 'frozen' mode. Any application that tries to read such
raid gets unfortunatelly bloked.

As some sort of protection try to skip such raid device from being
scanned to minimize chances to block lvm2 command on such scan.

When such device is found, warning gets printed.

6 years agocleanup: all tests needs target_type
Zdenek Kabelac [Thu, 8 Mar 2018 12:01:12 +0000 (13:01 +0100)]
cleanup: all tests needs target_type

Simplify code.

6 years agodev_manager: always activate RAID SubLVs readwrite
Heinz Mauelshagen [Mon, 12 Mar 2018 21:21:13 +0000 (22:21 +0100)]
dev_manager: always activate RAID SubLVs readwrite

RaidLVs on read_only_volume_list have their SubLVs
activated readonly thus disabling metadata updates
or image resynchronization/recovery.  Bug also causes
automatic repairs to fail.

Fix by always activating the RAID SubLVs readwrite.

Resolves: rhbz1208269

6 years agoraid: support raid5_n convenience type on conversion to raid10
Heinz Mauelshagen [Fri, 9 Mar 2018 20:15:41 +0000 (21:15 +0100)]
raid: support raid5_n convenience type on conversion to raid10

Fix requesting a conversion on raid5_{ls,rs,la,ra} -> raid10
not offering offering interim convenience type raid5_n.

Resolves: rhbz1468600

6 years agocleanup: use log_warn
Zdenek Kabelac [Thu, 8 Mar 2018 09:29:49 +0000 (10:29 +0100)]
cleanup: use log_warn

There message are not causing command failure thus turn them
into warnings.

6 years agocache: fix lock usage for cache conversion
Zdenek Kabelac [Thu, 8 Mar 2018 09:30:46 +0000 (10:30 +0100)]
cache: fix lock usage for cache conversion

Just like with lvcreate, this lvconvert case also need to properly
check which LV actually holds lock for cached origin - as it might
be i.e. thin-pool tdata subLV.

6 years agosnapshot: skip invalid snapshost
Zdenek Kabelac [Thu, 8 Mar 2018 09:32:15 +0000 (10:32 +0100)]
snapshot: skip invalid snapshost

When scanning DM device, skip automatically invalid snapshot devices.
They behave just like 'error' device.

6 years agosnapshot: keep COW writable for read-only volumes
Zdenek Kabelac [Thu, 8 Mar 2018 09:27:04 +0000 (10:27 +0100)]
snapshot: keep COW writable for read-only volumes

When snapshot is created in read-only mode with 'lvcreate -s -pr...',
lvm2 still needs to be able to write to layered -cow volume
to store metadata and exceptions blocks.

TODO: in some case we might be able to do full tree with read-only
volume but this probably needs futher validation:
1. checking snapshot header already exist
2. origin & snapshot are both in read-only mode.

6 years agotests: skipping test waiting for fixed kernel
Zdenek Kabelac [Tue, 6 Mar 2018 14:32:27 +0000 (15:32 +0100)]
tests: skipping test waiting for fixed kernel

Once working kernel is released, reenable me...

6 years agotests: component activation
Zdenek Kabelac [Fri, 2 Mar 2018 14:07:25 +0000 (15:07 +0100)]
tests: component activation

6 years agoactivation: support proper /dev names for component LVs
Zdenek Kabelac [Wed, 28 Feb 2018 16:22:09 +0000 (17:22 +0100)]
activation: support proper /dev names for component LVs

When LV is activated AS componet LV - ensure there will
be /dev/vgname/lvname  link present for such LV.

6 years agoactivation: support activation of component LVs
Zdenek Kabelac [Wed, 28 Feb 2018 16:16:17 +0000 (17:16 +0100)]
activation: support activation of component LVs

Occasionaly users may need to peek into 'component devices.
Normally lvm2 does not let users activation component.

This patch adds special mode where user can activate
component LV in a 'read-only' mode i.e.:

lvchange -ay vg/pool_tdata

All devices can be deactivated with:

lvchange -an vg  |  vgchange -an....

6 years agolvconvert: support for convertsion with active component devices
Zdenek Kabelac [Fri, 2 Mar 2018 15:34:09 +0000 (16:34 +0100)]
lvconvert: support for convertsion with active component devices

If componet devices could be activated alone, ensure they are not breaking
common commands.

TODO: mostly likely this is not a definite list of all needed checks
and more will come later.

6 years agolvremove: ensure no subLV is active
Zdenek Kabelac [Fri, 2 Mar 2018 21:07:14 +0000 (22:07 +0100)]
lvremove: ensure no subLV is active

Since component activation is going to be enabled, enusure,
no subLV is active when we deactivate LV.

6 years agolvremove: validate removed component LV is not active
Zdenek Kabelac [Fri, 2 Mar 2018 15:32:05 +0000 (16:32 +0100)]
lvremove: validate removed component LV is not active

This is the 'last' place where a LV is present in metadata.
Any removed device should not be left active in dm table.
So this check is an extra validation protection to capture any
forgotten deactivation (adding 1 extra ioctl into lvremove path)

6 years agoactivation: add base lv component function
Zdenek Kabelac [Tue, 27 Feb 2018 13:13:00 +0000 (14:13 +0100)]
activation: add base lv component function

Introduce:

lv_is_component() check is LV is actually a component device.

lv_component_is_active() checking if any component device is active.

lv_holder_is_active() is any component holding device is active.

6 years agodebug: update comment
Zdenek Kabelac [Fri, 2 Mar 2018 14:06:36 +0000 (15:06 +0100)]
debug: update comment

6 years agocleanup: more usage of dm_strncpy
Zdenek Kabelac [Fri, 2 Mar 2018 15:25:37 +0000 (16:25 +0100)]
cleanup: more usage of dm_strncpy

Use existing wrapper function arournd  strncpy + buf[] = 0;

6 years agolvremove: drop duplicate check for active LV
Zdenek Kabelac [Tue, 6 Mar 2018 12:31:06 +0000 (13:31 +0100)]
lvremove: drop duplicate check for active LV

Since this code branch already tested LV is active,
avoid repeating same query.

6 years agolvcreate: fix activation of cached LV
Zdenek Kabelac [Mon, 5 Mar 2018 11:54:39 +0000 (12:54 +0100)]
lvcreate: fix activation of cached LV

Since LV for caching can be already a stacked LV, proper activation
needs to use lock holding LV.

6 years agoraid: move VG update after archiving happened
Zdenek Kabelac [Tue, 6 Mar 2018 12:38:00 +0000 (13:38 +0100)]
raid: move VG update after archiving happened

Update of LV le_count needs to happen after archive().

6 years agoraid: fix error path for lv_raid_data_offset
Zdenek Kabelac [Fri, 2 Mar 2018 14:49:12 +0000 (15:49 +0100)]
raid: fix error path for lv_raid_data_offset

Avoid using allocated status on error path.

6 years agothin: pass environment to scripts
Zdenek Kabelac [Mon, 5 Mar 2018 14:09:16 +0000 (15:09 +0100)]
thin: pass environment to scripts

When dmeventd thin plugin forks a configurable script, switch to use
execvp to pass whole environment present to dmeventd - so all configured
paths present at dmeventd startup are visible to script.

This was likely not a problem for common user enviroment,
however in test suite case variable like LVM_SYSTEM_DIR were
not actually used from test itself but rather from
a system present lvm.conf and this may have cause strange
behavior of a testing script.

6 years agocleanup: indent
Zdenek Kabelac [Mon, 26 Feb 2018 13:44:51 +0000 (14:44 +0100)]
cleanup: indent

6 years agocleanup: use lv_is_used_cache_pool
Zdenek Kabelac [Wed, 28 Feb 2018 16:38:43 +0000 (17:38 +0100)]
cleanup: use lv_is_used_cache_pool

Use lv_is_used_cache_pool() to simplify the code.
Function was introduced later and this code missed to use it.

6 years agocleanup: explicitely ignore result code
Zdenek Kabelac [Sun, 25 Feb 2018 15:18:31 +0000 (16:18 +0100)]
cleanup: explicitely ignore result code

ATM too long prefix is silently ignored.

6 years agocleanup: unused header file
Zdenek Kabelac [Sun, 25 Feb 2018 15:18:11 +0000 (16:18 +0100)]
cleanup: unused header file

6 years agodebug: change message severity
Zdenek Kabelac [Wed, 21 Feb 2018 13:08:17 +0000 (14:08 +0100)]
debug: change message severity

Although it's internal issue - in this case command continue without
any reported error - thus hide this internal error into debug.

6 years agotests: check inactive extorig resize
Zdenek Kabelac [Wed, 28 Feb 2018 18:03:20 +0000 (19:03 +0100)]
tests: check inactive extorig resize

6 years agolvresize: check external origin with new size
Zdenek Kabelac [Wed, 28 Feb 2018 16:04:26 +0000 (17:04 +0100)]
lvresize: check external origin with new size

Instead of checking with existing size of external origin LV,
use correctly the new 'wanted' size of this LV whether it fits
the limitiation requirements for older thin-pool target.

Otherwise code started to the the resize, updates metadata and
just fails during 'resize' in case the LV was active. For
inactive LV operation could have actually passed.

6 years agolvremove: drop unneded check
Zdenek Kabelac [Wed, 28 Feb 2018 16:37:03 +0000 (17:37 +0100)]
lvremove: drop unneded check

Checking here for cache_pool is not necessary and in effect
the check is not even right - since there are internal
states that do allow to active such LV.

6 years agocommand: use bigger buffer
Zdenek Kabelac [Wed, 28 Feb 2018 15:57:53 +0000 (16:57 +0100)]
command: use bigger buffer

Instead of use 'silently' shortened passed string - always
make sure we take either a full copy or return error.

6 years agolv_manip: enhance for_each_sub_lv
Zdenek Kabelac [Wed, 28 Feb 2018 16:00:33 +0000 (17:00 +0100)]
lv_manip: enhance for_each_sub_lv

Fix missing 'externalLV' traversing for thins with external origins.

Replace extra for_each_sub_lv_except_pools() with better
internal logic allowing selectively to cut of processed subLV tree.

Extend error code for function 'fn()' when it returns -1 it will
stop futher tree scan for given LV.

Also a bit simplify code to have only one place that
is calling 'fn()' and use level counter to know
depth of traversing.

Update renaming travering to skip trees for pools
and external origins.

6 years agoio: keep 64b arithmetic
Zdenek Kabelac [Sun, 25 Feb 2018 21:32:14 +0000 (22:32 +0100)]
io: keep 64b arithmetic

Widen to 64b arithmetic from start.

6 years agoraid: add free for error path
Zdenek Kabelac [Sun, 25 Feb 2018 15:20:30 +0000 (16:20 +0100)]
raid: add free for error path

Recent patch forget to release now allocated 'dso' on error path.

6 years agocoverity: missing free on error path
Zdenek Kabelac [Sun, 25 Feb 2018 15:17:42 +0000 (16:17 +0100)]
coverity: missing free on error path

6 years agotests: check vgsplit thin-data and ext.origin
Marian Csontos [Tue, 27 Feb 2018 12:45:39 +0000 (13:45 +0100)]
tests: check vgsplit thin-data and ext.origin

6 years agotests: correct usage of pipe
Zdenek Kabelac [Sat, 17 Feb 2018 10:24:32 +0000 (11:24 +0100)]
tests: correct usage of pipe

This is somewhat tricky - for test suite we keep using
'set -e -o pipefail'  - the effect here is - we get error report
from any 'failing' command in whole pipeline - thus when something
like this:   'lvs | head -1'  is used - and  'head' finishes before
lead 'lvs' is done - it recieves SIGPIPE and exits with error,
and somewhat misleading gets occasionally reported depending
of speed of commands.

For this case we have to avoid using standard pipes and rather
switch to using streamed results with temporary output file.
This is all nicely handled with bash feature '< <()'.

For more info:
https://stackoverflow.com/questions/41516177/bash-zcat-head-causes-pipefail

6 years agodebug: capture internal error for too long resource name
Zdenek Kabelac [Mon, 19 Feb 2018 14:30:55 +0000 (15:30 +0100)]
debug: capture internal error for too long resource name

Should never happen, so just put in internal error instead of silently
passing some shortened resource name.

6 years agolocking: move cache dropping to primary locking code
Zdenek Kabelac [Mon, 19 Feb 2018 15:31:52 +0000 (16:31 +0100)]
locking: move cache dropping to primary locking code

While 'file-locking' code always dropped cached VG before
lock was taken - other locking types actually missed this.

So while the cache dropping has been implement for i.e. clvmd,
actually running command in cluster keept using cache even
when the lock has been i.e. dropped and taken again.

This rather 'hard-to-hit' error was noticable in some
tests running in cluster where content of PV has been
changed (metadata-balance.sh)

Fix the code by moving cache dropping directly lock_vol() function.

TODO: it's kind of strange we should ever need drop_cached_metadata()
used in several places - this all should happen automatically
this some futher thinking here is likely needed.

6 years agosanlock: set proper return value
Zdenek Kabelac [Sat, 17 Feb 2018 10:23:19 +0000 (11:23 +0100)]
sanlock: set proper return value

In last patch one error path missed to assign correct return value.
Assing it directly to 'ret' as log_error was already reported.

6 years agodoc: Fixing VDO document
Marian Csontos [Fri, 16 Feb 2018 16:09:40 +0000 (17:09 +0100)]
doc: Fixing VDO document

6 years agotests: update
Zdenek Kabelac [Wed, 14 Feb 2018 22:08:26 +0000 (23:08 +0100)]
tests: update

6 years agopvmove: enhance accepted states of active LVs
Zdenek Kabelac [Thu, 15 Feb 2018 12:39:58 +0000 (13:39 +0100)]
pvmove: enhance accepted states of active LVs

Improve pvmove to accept 'locally' active LVs together with
exclusive active LVs.

In the 1st. phase it now recognizes whether exclusive pvmove is needed.
For this case only 'exclusively' or 'locally-only without remote
activative state' LVs are acceptable and all others are skipped.

During build-up of pvmove 'activation' steps are taken, so if
there is any problem we can now 'skip' LVs from pvmove operation
rather then giving-up whole pvmove operation.

Also when pvmove is restarted, recognize need of exclusive pvmove,
and use it whenever there is LV, that require exclusive activation.

6 years agolocking: exclusive can be either remote or local
Zdenek Kabelac [Wed, 14 Feb 2018 22:06:49 +0000 (23:06 +0100)]
locking: exclusive can be either remote or local

When LOCK is exclusive and LV is already locally active,
it cannot be active remotely.

6 years agocleanup: add missing WARNING
Zdenek Kabelac [Thu, 15 Feb 2018 12:49:45 +0000 (13:49 +0100)]
cleanup: add missing WARNING

ATM log_warn() is supposed to be used with WARNING: prefix.

6 years agomirror: Add deprecation warning for mirrored log
Marian Csontos [Wed, 14 Feb 2018 11:46:08 +0000 (12:46 +0100)]
mirror: Add deprecation warning for mirrored log

6 years agotest: mirrored mirrorlog is not supposed to work in cluster
Marian Csontos [Tue, 13 Feb 2018 17:34:08 +0000 (18:34 +0100)]
test: mirrored mirrorlog is not supposed to work in cluster

6 years agogcc: remove warns about free of const
Zdenek Kabelac [Tue, 13 Feb 2018 18:53:07 +0000 (19:53 +0100)]
gcc: remove warns about free of const

6 years agosegtype: no libmem pool usage for name allocation
Zdenek Kabelac [Tue, 13 Feb 2018 18:06:35 +0000 (19:06 +0100)]
segtype: no libmem pool usage for name allocation

Allocate name with plain malloc & free.

6 years agosegtype: replace mempool allocation
Zdenek Kabelac [Tue, 13 Feb 2018 18:00:47 +0000 (19:00 +0100)]
segtype: replace mempool allocation

So this is a bit more complex and possibly worth futher checking.

ATM  clvmd drops  cmd->mem  mempool AFTER refresh of cmd.
So anything allocating from cmd->mem during toolcontext init
will likely die at some point in time.

As a quick fix - just use regular malloc/free for 'dso' alloction.

It's worth to note -  cmd->libmem seems to be often misused
causing hidden memleaking for clvmd.

6 years agodebug: add stack tracking
Zdenek Kabelac [Thu, 8 Feb 2018 10:03:06 +0000 (11:03 +0100)]
debug: add stack tracking

6 years agosegtype: better get_monitor_dso_path api
Zdenek Kabelac [Sat, 10 Feb 2018 19:22:32 +0000 (20:22 +0100)]
segtype: better get_monitor_dso_path api

Instead of allocating always 4K for dso path, use only real needed size.
Also simplify API call and move common functionality into function
itself.

6 years agocleanup: decode dso path just once
Zdenek Kabelac [Fri, 9 Feb 2018 22:40:37 +0000 (23:40 +0100)]
cleanup: decode dso path just once

Build dso plugin name during  segtype initialisation and just
use the string during command life-time.

Also slightlt update message verbosity and make it very_verbose
when operation is going to be made and 'verbose' when it's done.

6 years agoactivation: cleanup error to warning
Zdenek Kabelac [Mon, 12 Feb 2018 15:15:35 +0000 (16:15 +0100)]
activation: cleanup error to warning

Since for the code it's not fatal to fail on monitoring,
issue correct warning message instead of error.

6 years agoactivation: separate reporting of error and monitoring status
Zdenek Kabelac [Mon, 29 Jan 2018 15:28:57 +0000 (16:28 +0100)]
activation: separate reporting of error and monitoring status

Avoid using same return code for reporting 2 different things
and stricly report error code by return value and add new
parameter for reporting monitoring status.

This makes easier to recognize which error we got from dm_event
and continue only with  ENOENT.

6 years agocleanup: detect dmeventd_executable just once
Zdenek Kabelac [Fri, 9 Feb 2018 22:38:02 +0000 (23:38 +0100)]
cleanup: detect  dmeventd_executable just once

Avoid repeating debug messages about dmeventd executable
and just remember it once for whole cmd lifetime.

6 years agolvmlockd: improve dm path creation for sanlock LV
Zdenek Kabelac [Mon, 12 Feb 2018 20:50:57 +0000 (21:50 +0100)]
lvmlockd: improve dm path creation for sanlock LV

Use devmapper function to create matching dm name with mangling.
Drop extra '-1' from buffer passed to snprintf.

6 years agoclean: drop unneeded -1 for snprintf
Zdenek Kabelac [Mon, 12 Feb 2018 20:50:07 +0000 (21:50 +0100)]
clean: drop unneeded -1 for snprintf

man gives:
snprintf() and vsnprintf() write at most size bytes
(including the terminating null byte ('\0')) to str.

6 years agovgimportclone: add some dm_snprintf checks
Zdenek Kabelac [Fri, 9 Feb 2018 16:06:30 +0000 (17:06 +0100)]
vgimportclone: add some dm_snprintf checks

Check if the generated vg name still fits the buffer.
So too long strings are rejected.
Drop -1  from size passed to snprintf - as the \0 is already included.

6 years agolibdm-stats: correct checking of dm_snprintf error
Zdenek Kabelac [Mon, 12 Feb 2018 09:27:16 +0000 (10:27 +0100)]
libdm-stats: correct checking of dm_snprintf error

Function dm_snprintf returns -1 on error, while 0 is still
considered valid result code so correcting error path testing.

6 years agotoolcontext: light context missed to set-up mem mempool
Zdenek Kabelac [Fri, 9 Feb 2018 14:39:14 +0000 (15:39 +0100)]
toolcontext: light context missed to set-up mem mempool

If cmd->mem was null, then systemd generator was failing on:

(gdb) bt
dm_pool_alloc_aligned (p=0x0, s=96, alignment=8) at mm/pool-fast.c:95
dm_pool_alloc (p=0x0, s=96) at mm/pool-fast.c:90
dm_pool_zalloc (p=0x0, s=96) at mm/pool.c:74
config_file_read_fd (mem=0x0, cft=0x55f4339dbad0, dev=0x55f4339dfac0, reason=DEV_IO_MDA_CONTENT, offset=0, size=82293, offset2=0, size2=0,
    checksum_fn=0x0, checksum=0, checksum_only=0, no_dup_node_check=0, ioflags=0, config_file_read_fd_callback=0x0, config_file_read_fd_context=0x0) at config/config.c:567
config_file_read (mem=0x0, cft=0x55f4339dbad0) at config/config.c:658
config_file_open_and_read (config_file=0x7f49aef14540 <config_file> "/var/tmp/lvm/etc/lvm/lvm.conf", source=CONFIG_FILE, cmd=0x55f4339d6260)
    at config/config.c:282
_load_config_file (cmd=0x55f4339d6260, tag=0x7f49aeca15da "", local=0) at commands/toolcontext.c:824
_init_lvm_conf (cmd=0x55f4339d6260) at commands/toolcontext.c:853
create_config_context () at commands/toolcontext.c:1814
lvm_config_find_bool (libh=0x0, config_path=0x55f431a884ad "global/use_lvmetad", fail=0) at lvm_base.c:144
main ()

6 years agopython: add devmapper library to linking
Zdenek Kabelac [Fri, 9 Feb 2018 09:21:00 +0000 (10:21 +0100)]
python: add devmapper library to linking

On occasional gcc releases it's better to specify also -ldevmapper
to linking logic for python object.

It's in fact more correct since the liblvm.c code is using
libdevmapper functions - that were linked in only via
liblvm2app library.

6 years agopartial revert "command: Skip some memory zeroing."
Zdenek Kabelac [Fri, 9 Feb 2018 09:51:02 +0000 (10:51 +0100)]
partial revert "command: Skip some memory zeroing."

This partially reverts commit da37cbd24fc0073f3f00a3b7aac7807d2185b829.
As the _cmdline structure use mempool for allocated ellement
that is being release on cmd_context close.

Before the better fix is made - restore previous logic and
reinitialize cmd structures again for new cmd_context.

Problem can be hit with e.g. this test run:

make check_local T=foreign LVM_VALGRIND_DMEVENTD=1

Invalid read of size 1
   at 0x4C31C83: strcmp (vg_replace_strmem.c:846)
   by 0x6BA0939: _find_command (lvmcmdline.c:1555)
   by 0x6BA4304: lvm_run_command (lvmcmdline.c:2810)
   by 0x6BD5E02: lvm2_run (lvmcmdlib.c:91)
   by 0x685607E: dmeventd_lvm2_run (dmeventd_lvm.c:118)
   by 0x6652684: _use_policy (dmeventd_thin.c:117)
   by 0x6652E56: process_event (dmeventd_thin.c:298)
   by 0x10CC5A: _do_process_event (dmeventd.c:945)
   by 0x10CF83: _monitor_thread (dmeventd.c:1033)
   by 0x54B35E0: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
   by 0x57C30EE: clone (in /usr/lib64/libc-2.26.9000.so)
 Address 0x6266270 is 4,352 bytes inside a block of size 8,192 free'd
   at 0x4C2ED68: free (vg_replace_malloc.c:530)
   by 0x5289142: dm_free_wrapper (dbg_malloc.c:393)
   by 0x528998A: _free_chunk (pool-fast.c:318)
   by 0x52892A6: dm_pool_destroy (pool-fast.c:78)
   by 0x6A8E52C: destroy_toolcontext (toolcontext.c:2254)
   by 0x6BA5BD6: lvm_fin (lvmcmdline.c:3327)
   by 0x6BD5EA7: lvm2_exit (lvmcmdlib.c:123)
   by 0x6856013: dmeventd_lvm2_exit (dmeventd_lvm.c:103)
   by 0x66535B8: unregister_device (dmeventd_thin.c:432)
   by 0x10CBBC: _do_unregister_device (dmeventd.c:926)
   by 0x10CD74: _monitor_unregister (dmeventd.c:979)
   by 0x10D094: _monitor_thread (dmeventd.c:1066)
   by 0x54B35E0: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
   by 0x57C30EE: clone (in /usr/lib64/libc-2.26.9000.so)
 Block was alloc'd at
   at 0x4C2DBBB: malloc (vg_replace_malloc.c:299)
   by 0x5288F46: dm_malloc_aux (dbg_malloc.c:287)
   by 0x52890AC: dm_malloc_wrapper (dbg_malloc.c:371)
   by 0x52898E6: _new_chunk (pool-fast.c:286)
   by 0x52893BA: dm_pool_alloc_aligned (pool-fast.c:106)
   by 0x5289310: dm_pool_alloc (pool-fast.c:90)
   by 0x6A8A21A: _load_config_file (toolcontext.c:808)
   by 0x6A8A3D9: _init_lvm_conf (toolcontext.c:842)
   by 0x6A8D3BD: create_toolcontext (toolcontext.c:1941)
   by 0x6BA5B24: init_lvm (lvmcmdline.c:3308)
   by 0x6BD5B7C: cmdlib_lvm2_init (lvmcmdlib.c:34)
   by 0x6BD5EB8: lvm2_init (lvm2cmd.c:20)
   by 0x6855EA7: dmeventd_lvm2_init (dmeventd_lvm.c:67)
   by 0x665305F: register_device (dmeventd_thin.c:352)
   by 0x10CB7A: _do_register_device (dmeventd.c:916)
   by 0x10CEE4: _monitor_thread (dmeventd.c:1006)
   by 0x54B35E0: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
   by 0x57C30EE: clone (in /usr/lib64/libc-2.26.9000.so)

6 years agotoolcontext: do not change stream for pthreaded programs
Zdenek Kabelac [Thu, 8 Feb 2018 23:26:22 +0000 (00:26 +0100)]
toolcontext: do not change stream for pthreaded programs

With pthreaded daemons like 'dmeventd' using  liblvm via plugin,
lvm2 actually should not 'play' with streams at all - as there
could be parallel outputs running.

As a current quick workaround just disable change for pthreaded
program (gettid() != getpid()).

TODO: it's possible the change of buffering actually doesn't serve us
any measurable benefit and could be dropped as whole later...

Meanwhile this patch is fixing this occasional valgrind race report:

Invalid read of size 4
   at 0x571892C: vfprintf (in /usr/lib64/libc-2.26.9000.so)
   by 0x57216B3: fprintf (in /usr/lib64/libc-2.26.9000.so)
   by 0x5042886: dm_event_log (libdevmapper-event.c:925)
   by 0x10B015: _dmeventd_log (dmeventd.c:125)
   by 0x10D289: _unregister_for_event (dmeventd.c:1146)
   by 0x10E52E: _handle_request (dmeventd.c:1583)
   by 0x10E6D7: _do_process_request (dmeventd.c:1631)
   by 0x10E7C6: _process_request (dmeventd.c:1660)
   by 0x1101A4: main (dmeventd.c:2285)
 Address 0x6264d30 is 192 bytes inside a block of size 552 free'd
   at 0x4C2ED68: free (vg_replace_malloc.c:530)
   by 0x573907D: fclose@@GLIBC_2.2.5 (in /usr/lib64/libc-2.26.9000.so)
   by 0x6AC5C00: reopen_standard_stream (log.c:189)
   by 0x6A8E62C: destroy_toolcontext (toolcontext.c:2271)
   by 0x6BA5C22: lvm_fin (lvmcmdline.c:3339)
   by 0x6BD5EF3: lvm2_exit (lvmcmdlib.c:123)
   by 0x6856013: dmeventd_lvm2_exit (dmeventd_lvm.c:103)
   by 0x66535B8: unregister_device (dmeventd_thin.c:432)
   by 0x10CBBC: _do_unregister_device (dmeventd.c:926)
   by 0x10CD74: _monitor_unregister (dmeventd.c:979)
   by 0x10D094: _monitor_thread (dmeventd.c:1066)
   by 0x54B35E0: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
   by 0x57C30EE: clone (in /usr/lib64/libc-2.26.9000.so)
 Block was alloc'd at
   at 0x4C2DBBB: malloc (vg_replace_malloc.c:299)
   by 0x573932B: fdopen@@GLIBC_2.2.5 (in /usr/lib64/libc-2.26.9000.so)
   by 0x6AC5DC2: reopen_standard_stream (log.c:200)
   by 0x6A8D11D: create_toolcontext (toolcontext.c:1898)
   by 0x6BA5B6B: init_lvm (lvmcmdline.c:3319)
   by 0x6BD5BC8: cmdlib_lvm2_init (lvmcmdlib.c:34)
   by 0x6BD5F04: lvm2_init (lvm2cmd.c:20)
   by 0x6855EA7: dmeventd_lvm2_init (dmeventd_lvm.c:67)
   by 0x665305F: register_device (dmeventd_thin.c:352)
   by 0x10CB7A: _do_register_device (dmeventd.c:916)
   by 0x10CEE4: _monitor_thread (dmeventd.c:1006)
   by 0x54B35E0: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
   by 0x57C30EE: clone (in /usr/lib64/libc-2.26.9000.so)
....
Process terminating with default action of signal 6 (SIGABRT): dumping core
   at 0x570016B: raise (in /usr/lib64/libc-2.26.9000.so)
   by 0x5701520: abort (in /usr/lib64/libc-2.26.9000.so)
   by 0x57437D8: __libc_message (in /usr/lib64/libc-2.26.9000.so)
   by 0x5743831: __libc_fatal (in /usr/lib64/libc-2.26.9000.so)
   by 0x5744056: _IO_vtable_check (in /usr/lib64/libc-2.26.9000.so)
   by 0x574751C: __overflow (in /usr/lib64/libc-2.26.9000.so)
   by 0x574191A: fputc (in /usr/lib64/libc-2.26.9000.so)
   by 0x50428E3: dm_event_log (libdevmapper-event.c:934)
   by 0x10B015: _dmeventd_log (dmeventd.c:125)
   by 0x10D289: _unregister_for_event (dmeventd.c:1146)
   by 0x10E52E: _handle_request (dmeventd.c:1583)
   by 0x10E6D7: _do_process_request (dmeventd.c:1631)
   by 0x10E7C6: _process_request (dmeventd.c:1660)
   by 0x1101A4: main (dmeventd.c:2285)

6 years agoformat_text: Use versionsort to sort archive files
Alasdair G Kergon [Fri, 9 Feb 2018 01:08:55 +0000 (01:08 +0000)]
format_text: Use versionsort to sort archive files

Ensure that vg_100000-* follows vg_99999-* so that the expiry logic
doesn't stop too early.

   https://bugzilla.redhat.com/1481085

6 years agodevice: Fix basic async I/O error handling dev-agk-tmp
Alasdair G Kergon [Tue, 6 Feb 2018 21:43:06 +0000 (21:43 +0000)]
device: Fix basic async I/O error handling

6 years agodevice: Queue any aio beyond defined limits.
Alasdair G Kergon [Mon, 22 Jan 2018 18:26:03 +0000 (18:26 +0000)]
device: Queue any aio beyond defined limits.

6 years agolvmcache: Use asynchronous I/O when scanning devices.
Alasdair G Kergon [Mon, 22 Jan 2018 18:17:58 +0000 (18:17 +0000)]
lvmcache: Use asynchronous I/O when scanning devices.

6 years agodevice: Basic config and setup to support async I/O.
Alasdair G Kergon [Mon, 22 Jan 2018 17:45:12 +0000 (17:45 +0000)]
device: Basic config and setup to support async I/O.

6 years agodevice: Add flag to indicate that a code path can support AIO
Alasdair G Kergon [Mon, 22 Jan 2018 16:56:25 +0000 (16:56 +0000)]
device: Add flag to indicate that a code path can support AIO

Until the whole source supports AIO, library code can check for
AIO_SUPPORTED_CODE_PATH to determine whether or not it is OK
to use AIO.

6 years agocallbacks: Miscellaneous fixes for recent changes
Alasdair G Kergon [Mon, 22 Jan 2018 15:41:11 +0000 (15:41 +0000)]
callbacks: Miscellaneous fixes for recent changes

6 years agoconfigure: ensure path /usr/sbin is checked for some tools
Zdenek Kabelac [Mon, 29 Jan 2018 15:20:53 +0000 (16:20 +0100)]
configure: ensure path /usr/sbin is checked for some tools

Some tools are typically installed into /usr/sbin (or /sbin) dir.
And some systems do not add this path to user's $PATH var.

Ensure sbin paths are looked through...

6 years agolibdm: accept mirror status with userspace word in the line
Zdenek Kabelac [Thu, 1 Feb 2018 19:53:39 +0000 (20:53 +0100)]
libdm: accept mirror status with userspace word in the line

Just making sure the parser will not stop - although greater level of
support needs to be added (Describing doc seems to be missing however).

6 years agopvmove: reinstantiate clustered pvmove
Zdenek Kabelac [Wed, 31 Jan 2018 09:53:09 +0000 (10:53 +0100)]
pvmove: reinstantiate clustered pvmove

In fact  pvmove does support  'clustered-core' target for clustered
pvmove of LVs activated on multiple nodes.

This patch restores support for activation of pvmove on all nodes
for LVs that are also activate on all nodes.

6 years agolvmdbusd: Remove duplicated DataPercent definition
Tim Foerster [Fri, 22 Dec 2017 12:33:53 +0000 (13:33 +0100)]
lvmdbusd: Remove duplicated DataPercent definition

6 years agodoc: Add VDO stacking document
Marian Csontos [Thu, 25 Jan 2018 10:12:38 +0000 (11:12 +0100)]
doc: Add VDO stacking document

6 years agodev_io: fix writes for unaligned buffers
Zdenek Kabelac [Tue, 23 Jan 2018 12:36:12 +0000 (13:36 +0100)]
dev_io: fix writes for unaligned buffers

Actually the removed code is necessary - since not all writes are
getting alligned buffer - older compilers seems to be not able
to create 4K aligned buffers on stack - this the aligning code still
need to be present for write path.

6 years agotests: update set of devices
Zdenek Kabelac [Tue, 23 Jan 2018 09:21:58 +0000 (10:21 +0100)]
tests: update set of devices

Previous change added slighly more complex mapping so missed to update
few pieces.

6 years agodebug: drop DEBUG_MEM path
Zdenek Kabelac [Tue, 23 Jan 2018 10:41:53 +0000 (11:41 +0100)]
debug: drop DEBUG_MEM path

Memory is not allocated so no DEBUG_MEM part is needed.

6 years agopython: some LVs do need exclusive activation
Zdenek Kabelac [Mon, 22 Jan 2018 10:39:05 +0000 (11:39 +0100)]
python: some LVs do need exclusive activation

6 years agodevice: Add ioflags parameter to transfer additional state.
Alasdair G Kergon [Sun, 21 Jan 2018 15:41:49 +0000 (15:41 +0000)]
device: Add ioflags parameter to transfer additional state.

Flags are set on the initial I/O and passed to any callbacks that
may in turn issue further I/O using the inherited flags.

6 years agoactivation: move check later
Zdenek Kabelac [Wed, 17 Jan 2018 14:15:43 +0000 (15:15 +0100)]
activation: move check later

Check for lv when it's known in all cases.

6 years agotests: check pvmove is merging segments
Zdenek Kabelac [Fri, 1 Dec 2017 10:58:38 +0000 (11:58 +0100)]
tests: check pvmove is merging segments

pvmove was imporoved to properly merge consqutive segments after pvmove
so check it's working.

6 years agotests: longer startup timeout for daemons with valgrind
Zdenek Kabelac [Mon, 15 Jan 2018 15:26:34 +0000 (16:26 +0100)]
tests: longer startup timeout for daemons with valgrind

It's getting noticable somewhat slower...

6 years agotests: check preserved exclusivness of snapshot merge
Zdenek Kabelac [Mon, 15 Jan 2018 12:29:14 +0000 (13:29 +0100)]
tests: check preserved exclusivness of snapshot merge

Detect if origin remains exclusively activated after merging.

6 years agotests: properly test with clustered VG
Zdenek Kabelac [Thu, 11 Jan 2018 15:05:44 +0000 (16:05 +0100)]
tests: properly test with clustered VG

Testing in cluster makes sense only with clustered VG.

6 years agocleanup: drop unused code
Zdenek Kabelac [Thu, 11 Jan 2018 15:11:21 +0000 (16:11 +0100)]
cleanup: drop unused code

6 years agocleanup: enhance messages
Zdenek Kabelac [Thu, 11 Jan 2018 09:46:04 +0000 (10:46 +0100)]
cleanup: enhance messages

Add extra info about failing local exlusive activation
(as in cluster the LV can be active on some other nodes).

6 years agoactivation: guard exclusive activation
Zdenek Kabelac [Mon, 15 Jan 2018 15:26:00 +0000 (16:26 +0100)]
activation: guard exclusive activation

Add protectional internall error whenever we spot activation
of 'exclusive' only segments in 'non-exclusive' mode.

TODO: possibly the activation locking could be enhanced to handle
this fully behind the scene - as for now this works purely for
lvchange/vgchange activation.

6 years agodmeventd: add check for result code
Zdenek Kabelac [Fri, 5 Jan 2018 20:08:24 +0000 (21:08 +0100)]
dmeventd: add check for result code

Check result from pthread_kill.

6 years agopvmove: drop misleading pvmove restriction for cluster
Zdenek Kabelac [Thu, 11 Jan 2018 15:15:16 +0000 (16:15 +0100)]
pvmove: drop misleading pvmove restriction for cluster

pvmove handles properly locked LVs in cluster and this extra check
actually cause misbehavior as some LVs were silently skipped from
operation scope.

6 years agopvmove: better check for exclusive LV
Zdenek Kabelac [Fri, 12 Jan 2018 14:59:07 +0000 (15:59 +0100)]
pvmove: better check for exclusive LV

6 years agopvmove: fix _remove_sibling_pvs_from_trim_list
Zdenek Kabelac [Thu, 11 Jan 2018 12:21:08 +0000 (13:21 +0100)]
pvmove: fix _remove_sibling_pvs_from_trim_list

Fix the function to really check it sibling raid image LV.
For LV_rmeta_0  check for   LV_rimage_0   instead of
LV_rmeta_0rimage_0.

6 years agolvconvert: use excl activation for conversion
Zdenek Kabelac [Fri, 12 Jan 2018 12:34:13 +0000 (13:34 +0100)]
lvconvert: use excl activation for conversion

Use properly exclusive activation when reactivating origin after
snapshot merge (since origin must have been previously also exlusively
activated).

Same applies when converting volumes to thin-pool or cache.

Previously used 'only' local activation incorrectly allowed local
activation of some targets (i.e. raid) - thus 'leaking' chance to
activate same device on another node - which can be a problem
for device types like raid.

6 years agodevice: Move buffer allocation nearer to the I/O.
Alasdair G Kergon [Tue, 16 Jan 2018 01:12:08 +0000 (01:12 +0000)]
device: Move buffer allocation nearer to the I/O.

Don't allocate memory until it's needed - later we'll add
some of the I/O to an internal queue instead of issuing it
immediately.

6 years agodevice: Merge _dev_read and dev_read_callback.
Alasdair G Kergon [Tue, 16 Jan 2018 00:41:42 +0000 (00:41 +0000)]
device: Merge _dev_read and dev_read_callback.

6 years agoformat_text: Refactor mda counting in label processing.
Alasdair G Kergon [Mon, 15 Jan 2018 20:43:51 +0000 (20:43 +0000)]
format_text: Refactor mda counting in label processing.

6 years agoformat_text: Change update_mda_baton to use label not labeller
Alasdair G Kergon [Mon, 15 Jan 2018 20:13:53 +0000 (20:13 +0000)]
format_text: Change update_mda_baton to use label not labeller

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