]> sourceware.org Git - lvm2.git/log
lvm2.git
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

6 years agodevice: Rearrange _aligned_io().
Alasdair G Kergon [Mon, 15 Jan 2018 19:59:28 +0000 (19:59 +0000)]
device: Rearrange _aligned_io().

6 years agodevice: Add reason to devbuf.
Alasdair G Kergon [Mon, 15 Jan 2018 19:38:18 +0000 (19:38 +0000)]
device: Add reason to devbuf.

6 years agodevice: Store offset to data instead of pointer.
Alasdair G Kergon [Mon, 15 Jan 2018 19:32:59 +0000 (19:32 +0000)]
device: Store offset to data instead of pointer.

We want to save the relative offset before we've allocated the
buffer's memory.

6 years agodevice: Reorder device.h before change.
Alasdair G Kergon [Mon, 15 Jan 2018 19:24:01 +0000 (19:24 +0000)]
device: Reorder device.h before change.

6 years agocommand: Skip some memory zeroing.
Alasdair G Kergon [Sat, 13 Jan 2018 03:36:53 +0000 (03:36 +0000)]
command: Skip some memory zeroing.

commands[] is in bss, its content wouldn't change if reinitialised
and unregister has no memory to free so don't bother.

6 years agolibdm: Fix a size_t in _dm_malloc_aligned_aux message.
Alasdair G Kergon [Thu, 11 Jan 2018 22:19:41 +0000 (22:19 +0000)]
libdm: Fix a size_t in _dm_malloc_aligned_aux message.

6 years agoman: regenerate
Alasdair G Kergon [Fri, 12 Jan 2018 00:30:52 +0000 (00:30 +0000)]
man: regenerate

6 years agolabel: Clean up storing of device and label sector.
Alasdair G Kergon [Thu, 11 Jan 2018 02:39:30 +0000 (02:39 +0000)]
label: Clean up storing of device and label sector.

No longer use the external 'result' pointer internally to set up the
cached label.  The callback _set_label_read_result() is now given the
internal label pointer directly

Callers that don't need the result are no longer required to pass a
label pointer into label_read().

6 years agoconfig: Move use_mmap to local variable.
Alasdair G Kergon [Wed, 10 Jan 2018 20:35:02 +0000 (20:35 +0000)]
config: Move use_mmap to local variable.

6 years agodevice: Mark read-only device buffers const.
Alasdair G Kergon [Wed, 10 Jan 2018 19:50:53 +0000 (19:50 +0000)]
device: Mark read-only device buffers const.

6 years agodevice: Eliminate unnecessary buffer from dev_read.
Alasdair G Kergon [Wed, 10 Jan 2018 18:48:01 +0000 (18:48 +0000)]
device: Eliminate unnecessary buffer from dev_read.

6 years agodevice: Suppress repeated reads of the same data.
Alasdair G Kergon [Wed, 10 Jan 2018 13:19:12 +0000 (13:19 +0000)]
device: Suppress repeated reads of the same data.

If the data being requested is present in last_[extra_]devbuf,
return that directly instead of reading it from disk again.

Typical LVM2 access patterns request data within two adjacent 4k blocks
so we eliminate some read() system calls by always reading at least 8k.

6 years agodevice: Remove some data copying between buffers.
Alasdair G Kergon [Wed, 10 Jan 2018 13:18:56 +0000 (13:18 +0000)]
device: Remove some data copying between buffers.

Callers that read larger amounts of data now get a pointer to read-only
data directly without copying it through an intermediate buffer.  This
data is owned by the device layer so the callers no longer free it.

6 years agodevice: Free cached device bufs when metadata invalid or dev closed.
Alasdair G Kergon [Wed, 10 Jan 2018 12:03:31 +0000 (12:03 +0000)]
device: Free cached device bufs when metadata invalid or dev closed.

6 years agodevice: Keep the last data buffer read off each device.
Alasdair G Kergon [Wed, 10 Jan 2018 02:09:06 +0000 (02:09 +0000)]
device: Keep the last data buffer read off each device.

If there's a second metadata area on device, we record that separately.

Note that the memory requirements aren't restricted yet.

6 years agoallocation: Avoid exceeding array bounds in allocation tag code
Alasdair G Kergon [Wed, 10 Jan 2018 02:03:32 +0000 (02:03 +0000)]
allocation: Avoid exceeding array bounds in allocation tag code

If _limit_to_one_area_per_tag() changes nothing it writes beyond
the array.

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