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

6 years agoformat_text: Use malloc aligned for export buffer
Alasdair G Kergon [Tue, 9 Jan 2018 21:52:19 +0000 (21:52 +0000)]
format_text: Use malloc aligned for export buffer

6 years agolabel: Rename a variable
Alasdair G Kergon [Tue, 9 Jan 2018 21:13:46 +0000 (21:13 +0000)]
label: Rename a variable

6 years agolibdm: Introduce dm_malloc_aligned
Alasdair G Kergon [Tue, 9 Jan 2018 20:25:43 +0000 (20:25 +0000)]
libdm: Introduce dm_malloc_aligned

6 years agoman lvmlockd: remove lv resizing comment
David Teigland [Wed, 10 Jan 2018 15:15:52 +0000 (09:15 -0600)]
man lvmlockd: remove lv resizing comment

6 years agolvmlockd: print warning when skipping locking
David Teigland [Tue, 9 Jan 2018 17:46:00 +0000 (11:46 -0600)]
lvmlockd: print warning when skipping locking

6 years agolvmlockd: add lockopt values for skipping selected locks
David Teigland [Tue, 9 Jan 2018 17:18:57 +0000 (11:18 -0600)]
lvmlockd: add lockopt values for skipping selected locks

and add lockopt to common options.

6 years agoformat_text: Use vgsummary callbacks
Alasdair G Kergon [Tue, 9 Jan 2018 01:50:23 +0000 (01:50 +0000)]
format_text: Use vgsummary callbacks

6 years agolabel: Add label_read callback.
Alasdair G Kergon [Mon, 8 Jan 2018 23:08:22 +0000 (23:08 +0000)]
label: Add label_read callback.

6 years agolabel: Add callback fns (partially)
Alasdair G Kergon [Sun, 7 Jan 2018 03:43:25 +0000 (03:43 +0000)]
label: Add callback fns (partially)

6 years agodevice: Introduce dev_read_callback
Alasdair G Kergon [Sat, 6 Jan 2018 00:33:09 +0000 (00:33 +0000)]
device: Introduce dev_read_callback

If it obtains the data, it passes it into the supplied callback function
and returns 1.  Otherwise the callback receives failed = 1.

Updated config_file_read_fd to use this and similarly return the data
via a callback fn of its own.

6 years agometadata: Use a consistent format for callback fn parameters
Alasdair G Kergon [Fri, 5 Jan 2018 14:24:10 +0000 (14:24 +0000)]
metadata: Use a consistent format for callback fn parameters

6 years agometadata: Change the new data processing fns to void.
Alasdair G Kergon [Fri, 5 Jan 2018 02:31:28 +0000 (02:31 +0000)]
metadata: Change the new data processing fns to void.

Move the existing fn return codes into the new structs.

6 years agoformat_text: Split vgname_from_mda into three pieces.
Alasdair G Kergon [Thu, 4 Jan 2018 21:13:44 +0000 (21:13 +0000)]
format_text: Split vgname_from_mda into three pieces.

6 years agoformat_text: Split out raw_read_mda_header processing
Alasdair G Kergon [Thu, 4 Jan 2018 15:52:59 +0000 (15:52 +0000)]
format_text: Split out raw_read_mda_header processing

6 years agoformat_text: Split up _update_mda.
Alasdair G Kergon [Thu, 4 Jan 2018 00:56:34 +0000 (00:56 +0000)]
format_text: Split up _update_mda.

Dedicated functions are now used to process each piece of data obtained,
so the refactoring in this file gives us one for the vgsummary and one
for the metadata header.  This new type of function takes two parameters
(for now), the obtained data plus a single struct (that must not
reference any data on the stack) that wraps up the entire context needed
to process it.

6 years agoformat_text: Allocate update_mda baton from mempool.
Alasdair G Kergon [Wed, 3 Jan 2018 23:53:00 +0000 (23:53 +0000)]
format_text: Allocate update_mda baton from mempool.

Also store return code.  Note that fatal and non-fatal errors while
handling the mda aren't currently distinguished.

6 years agoformat_text: Split the text import fns into two pieces.
Alasdair G Kergon [Wed, 3 Jan 2018 16:00:52 +0000 (16:00 +0000)]
format_text: Split the text import fns into two pieces.

6 years agotoolcontext: Add paired label_init to refresh_toolcontext.
Alasdair G Kergon [Tue, 2 Jan 2018 22:00:31 +0000 (22:00 +0000)]
toolcontext: Add paired label_init to refresh_toolcontext.

label_init() and label_exit() should be paired.

6 years agoconfig: Split config buffer processing into new fn.
Alasdair G Kergon [Tue, 2 Jan 2018 20:40:18 +0000 (20:40 +0000)]
config: Split config buffer processing into new fn.

Wrap its parameters into struct process_config_file_params allocated
from a mempool now passed into the config_file_read* fns.

6 years agoman lvmlockd: update wording
David Teigland [Tue, 2 Jan 2018 19:10:34 +0000 (13:10 -0600)]
man lvmlockd: update wording

6 years agolabel: Wrap _find_labeller params into a struct.
Alasdair G Kergon [Tue, 2 Jan 2018 16:01:10 +0000 (16:01 +0000)]
label: Wrap _find_labeller params into a struct.

Move the actual buffer reading up to _label_read() so _find_labeller()
just examines the buffer supplied.

6 years agolabel: Move _set_label_read_result call into _find_labeller.
Alasdair G Kergon [Tue, 2 Jan 2018 14:58:21 +0000 (14:58 +0000)]
label: Move _set_label_read_result call into _find_labeller.

Move responsibility for setting the label_read() result parameter down
into _find_labeller().

6 years agolabel: Move setting result of label_read into separate fn.
Alasdair G Kergon [Tue, 2 Jan 2018 14:19:20 +0000 (14:19 +0000)]
label: Move setting result of label_read into separate fn.

6 years agolabel: Add mempool.
Alasdair G Kergon [Tue, 2 Jan 2018 13:37:12 +0000 (13:37 +0000)]
label: Add mempool.

6 years agotests: sleep first
Zdenek Kabelac [Wed, 13 Dec 2017 15:17:56 +0000 (16:17 +0100)]
tests: sleep first

Sleep a bit before checking /sys/block dir so the kernel has a moment to
actually put scsi debug device in it...

Some quite old kernels are in troubles with this plain searching grep
without sleep (namely 2.6.32)

modprobe scsi_debug
 <sleep .1>
grep -H scsi_debug /sys/block/*/device/model
modprobe -r scsi_debug

6 years agolvm-string: add function to detect component LV suffix
Zdenek Kabelac [Mon, 11 Dec 2017 17:12:47 +0000 (18:12 +0100)]
lvm-string: add function to detect component LV suffix

Add is_component_lvname() function to recognize component LV name.

6 years agodevice: Move dev_read memory allocation into device layer.
Alasdair G Kergon [Tue, 19 Dec 2017 01:12:18 +0000 (01:12 +0000)]
device: Move dev_read memory allocation into device layer.

Rename dev_read() to dev_read_buf() - the function that reads data
into a supplied buffer.

Introduce a new dev_read() that allocates the buffer it returns and
switch the important users over to this.  No caller may change the
returned data.  (For now, callers are responsible for freeing it after
use, but later the device layer will take full ownership.)

dev_read_buf() should only be used for tiny buffers or unimportant code
(such as the old disk formats).

6 years agolvmlockd: clear coverity complaint
David Teigland [Mon, 18 Dec 2017 21:19:17 +0000 (15:19 -0600)]
lvmlockd: clear coverity complaint

from previous coverity fix, it's never happy.

6 years agopost-release
Alasdair G Kergon [Mon, 18 Dec 2017 20:43:09 +0000 (20:43 +0000)]
post-release

6 years agopre-release v2_02_177
Alasdair G Kergon [Mon, 18 Dec 2017 20:36:10 +0000 (20:36 +0000)]
pre-release

6 years agoformat_text: Transfer circular buf alloc to device layer.
Alasdair G Kergon [Fri, 15 Dec 2017 22:34:26 +0000 (22:34 +0000)]
format_text: Transfer circular buf alloc to device layer.

Instead of the caller passing dev_read_circular() a buffer to fill with
data, the device layer itself now allocates it.

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