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

7 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.

7 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...

7 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.

7 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.

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

7 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).

7 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.

7 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.

7 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.

7 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

7 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.

7 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.

7 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.

7 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.

7 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.

7 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

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

7 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.

7 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.

7 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.

7 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.

7 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.

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

7 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().

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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

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

7 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

7 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

7 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

7 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.

7 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

7 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.

7 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)

7 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.

7 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

7 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.

7 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.

7 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

7 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.

7 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.

7 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.

7 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.

7 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.

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

7 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.

7 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().

7 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.

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

7 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

7 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.

7 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).

7 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.

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

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

7 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.

7 years agoformat_text: Separate out code paths for buffer wraparound
Alasdair G Kergon [Fri, 15 Dec 2017 21:12:19 +0000 (21:12 +0000)]
format_text: Separate out code paths for buffer wraparound

The creation of wrapped around metadata - where the start of metadata is
written up to the end of the buffer and the remainder follows back at
the start of the buffer - is now restricted to cases where writing the
metadata in one piece wouldn't fit.  This shouldn't happen in 'normal'
usage so let's begin treating the code for this as a special case that
can be ignored when optimising 'normal' cases.

7 years agoformat_text: Supply mempool directly to raw_read_mda_header.
Alasdair G Kergon [Fri, 15 Dec 2017 14:57:05 +0000 (14:57 +0000)]
format_text: Supply mempool directly to raw_read_mda_header.

7 years agolvm2app: Suppress deprecation warnings for our builds
Marian Csontos [Thu, 14 Dec 2017 12:49:33 +0000 (13:49 +0100)]
lvm2app: Suppress deprecation warnings for our builds

7 years agolvmdbusd: Make lvmdbusd executable
Marian Csontos [Thu, 14 Dec 2017 12:40:05 +0000 (13:40 +0100)]
lvmdbusd: Make lvmdbusd executable

- Add files built from *.in to builddir files.
- Add all files built from *.in to DISTCLEAN_TARGETS.

7 years agodocs: Add TESTING file
Marian Csontos [Thu, 14 Dec 2017 14:42:34 +0000 (15:42 +0100)]
docs: Add TESTING file

7 years agotest: fix trap adding proper teardown to previous, new raid tests
Heinz Mauelshagen [Wed, 13 Dec 2017 13:39:06 +0000 (14:39 +0100)]
test: fix trap adding proper teardown to previous, new raid tests

Also remove superfluous variable.

7 years agotest: new raid tests
Heinz Mauelshagen [Wed, 13 Dec 2017 01:55:06 +0000 (02:55 +0100)]
test: new raid tests

Add three new raid tests with io load and table
reloads during reshape for target 1.13.2.

Add a raid0 to raid10 conversion test.

Also add more signals to trap in lvconvert-raid-reshape-load.sh.

7 years agoformat_text: Round size written up to multiple of 4096.
Alasdair G Kergon [Tue, 12 Dec 2017 22:52:22 +0000 (22:52 +0000)]
format_text: Round size written up to multiple of 4096.

Zero-fill metadata up to the next 4096 boundary then write out a
multiple of 4096 bytes to avoid triggering a read-modify-write.

7 years agoformat_text: Change metadata alignment from 512 to 4096.
Alasdair G Kergon [Tue, 12 Dec 2017 20:57:36 +0000 (20:57 +0000)]
format_text: Change metadata alignment from 512 to 4096.

If there is sufficient space in the metadata area, align the next
metadata to a disk offset that is a multiple of 4096 bytes and
don't write it circularly.  If it doesn't all fit at the end
of the metadata area, go back to the start and write it all there
contiguously.

If there is insufficient space to use the new stricter rules, revert to
the original behaviour, aligning on 512-byte boundaries wrapping around
the circular buffer as required.

7 years agoformat_text: More refactoring of metadata offset calcs
Alasdair G Kergon [Tue, 12 Dec 2017 18:46:25 +0000 (18:46 +0000)]
format_text: More refactoring of metadata offset calcs

7 years agoformat_text: Refactor and document metadata offset calculation.
Alasdair G Kergon [Tue, 12 Dec 2017 18:36:54 +0000 (18:36 +0000)]
format_text: Refactor and document metadata offset calculation.

7 years agodevice: Fix an unpaired device close.
Alasdair G Kergon [Tue, 12 Dec 2017 17:56:58 +0000 (17:56 +0000)]
device: Fix an unpaired device close.

dev_open_flags contains an unpaired dev_close_immediate so increment
open_count before calling it.

7 years agometadata: Consistently skip metadata areas that failed.
Alasdair G Kergon [Tue, 12 Dec 2017 17:49:35 +0000 (17:49 +0000)]
metadata: Consistently skip metadata areas that failed.

Even after writing some metadata encountered problems, some commands
continue (rightly or wrongly) and attempt to make further changes.

Once an mda is marked MDA_FAILED, don't try to use it again.
This also applies when reverting, where one loop already skips
failed mdas but the other doesn't.

This fixes some device open_count warnings on relevant failure paths.

7 years agotest: Fix condition when detecting lvmdbusd
Marian Csontos [Tue, 12 Dec 2017 13:18:27 +0000 (14:18 +0100)]
test: Fix condition when detecting lvmdbusd

7 years agodevice: Internal error if writing 0 bytes to dev.
Alasdair G Kergon [Tue, 12 Dec 2017 12:57:25 +0000 (12:57 +0000)]
device: Internal error if writing 0 bytes to dev.

7 years agolvmdbusd: All tools use detected python3
Marian Csontos [Tue, 12 Dec 2017 12:10:51 +0000 (13:10 +0100)]
lvmdbusd: All tools use detected python3

- lvmdb.py and lvm_shell_proxy.py can be used as standalone tools, so
  should use detected value.
- clean executable bit on *.in files.

7 years agotest: lvmdbusd is used for process name
Marian Csontos [Tue, 12 Dec 2017 11:14:15 +0000 (12:14 +0100)]
test: lvmdbusd is used for process name

lvmdbusd was started, but the process was not recognized by pgrep.

- configure does not make the script executable - set the flag
  explicitly when running make check,
- process name changed to lvmdbusd. The previous python3 value
  originated from the use of /usr/bin/env.

7 years agoformat_text: Adjust metadata alignment calculation.
Alasdair G Kergon [Mon, 11 Dec 2017 20:25:03 +0000 (20:25 +0000)]
format_text: Adjust metadata alignment calculation.

Use new ALIGN_ABSOLUTE macro when calculating the start location
of new metadata and adjust the end of buffer detection so that
there is no longer an imposed gap between old and new metadata.

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