1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

14993 Commits

Author SHA1 Message Date
Zdenek Kabelac
f3c75bb201 activation: move check later
Check for lv when it's known in all cases.
2018-01-17 15:15:43 +01:00
Zdenek Kabelac
e16d309d56 tests: check pvmove is merging segments
pvmove was imporoved to properly merge consqutive segments after pvmove
so check it's working.
2018-01-17 14:45:48 +01:00
Zdenek Kabelac
5baf2de898 tests: longer startup timeout for daemons with valgrind
It's getting noticable somewhat slower...
2018-01-17 14:45:48 +01:00
Zdenek Kabelac
8ebd45fde7 tests: check preserved exclusivness of snapshot merge
Detect if origin remains exclusively activated after merging.
2018-01-17 14:45:48 +01:00
Zdenek Kabelac
8c7ec44bf0 tests: properly test with clustered VG
Testing in cluster makes sense only with clustered VG.
2018-01-17 14:45:48 +01:00
Zdenek Kabelac
3aedaa7f2a cleanup: drop unused code 2018-01-17 14:45:48 +01:00
Zdenek Kabelac
38b81e6537 cleanup: enhance messages
Add extra info about failing local exlusive activation
(as in cluster the LV can be active on some other nodes).
2018-01-17 14:45:48 +01:00
Zdenek Kabelac
a8bcdef4fd 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.
2018-01-17 14:45:47 +01:00
Zdenek Kabelac
f41935909f dmeventd: add check for result code
Check result from pthread_kill.
2018-01-17 14:44:33 +01:00
Zdenek Kabelac
02621cffb0 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.
2018-01-17 14:44:33 +01:00
Zdenek Kabelac
5a961d3411 pvmove: better check for exclusive LV 2018-01-17 14:44:33 +01:00
Zdenek Kabelac
7c6fb63041 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.
2018-01-17 14:44:31 +01:00
Zdenek Kabelac
e86910b052 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.
2018-01-17 14:43:34 +01:00
Alasdair G Kergon
c26458339e 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.
2018-01-16 01:12:08 +00:00
Alasdair G Kergon
081902b4c1 device: Merge _dev_read and dev_read_callback. 2018-01-16 00:41:42 +00:00
Alasdair G Kergon
0a3c6bf8c6 format_text: Refactor mda counting in label processing. 2018-01-15 23:47:44 +00:00
Alasdair G Kergon
73b5ee64e7 format_text: Change update_mda_baton to use label not labeller 2018-01-15 20:13:53 +00:00
Alasdair G Kergon
b825987b2f device: Rearrange _aligned_io(). 2018-01-15 20:10:54 +00:00
Alasdair G Kergon
c90582344d device: Add reason to devbuf. 2018-01-15 19:38:18 +00:00
Alasdair G Kergon
1f01eaa612 device: Store offset to data instead of pointer.
We want to save the relative offset before we've allocated the
buffer's memory.
2018-01-15 19:32:59 +00:00
Alasdair G Kergon
61d3296f2a device: Reorder device.h before change. 2018-01-15 19:24:01 +00:00
Alasdair G Kergon
da37cbd24f 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.
2018-01-13 03:44:15 +00:00
Alasdair G Kergon
e4e2abc8bc libdm: Fix a size_t in _dm_malloc_aligned_aux message. 2018-01-12 00:42:53 +00:00
Alasdair G Kergon
5bbe68cf15 man: regenerate 2018-01-12 00:30:52 +00:00
Alasdair G Kergon
35cdd9cf48 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().
2018-01-11 02:54:00 +00:00
Alasdair G Kergon
f771d3f870 config: Move use_mmap to local variable. 2018-01-10 20:35:02 +00:00
Alasdair G Kergon
6210c1ec28 device: Mark read-only device buffers const. 2018-01-10 19:57:10 +00:00
Alasdair G Kergon
c350f96c09 device: Eliminate unnecessary buffer from dev_read. 2018-01-10 18:48:01 +00:00
Alasdair G Kergon
366493a1d1 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.
2018-01-10 15:52:03 +00:00
Alasdair G Kergon
dcb2a5a611 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.
2018-01-10 15:48:03 +00:00
Alasdair G Kergon
4d568b709c device: Free cached device bufs when metadata invalid or dev closed. 2018-01-10 15:48:03 +00:00
Alasdair G Kergon
bd0967a4b1 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.
2018-01-10 15:48:03 +00:00
Alasdair G Kergon
bacc942333 allocation: Avoid exceeding array bounds in allocation tag code
If _limit_to_one_area_per_tag() changes nothing it writes beyond
the array.
2018-01-10 15:48:03 +00:00
Alasdair G Kergon
e2438b5b9f format_text: Use malloc aligned for export buffer 2018-01-10 15:48:03 +00:00
Alasdair G Kergon
b65246499b label: Rename a variable 2018-01-10 15:48:03 +00:00
Alasdair G Kergon
ea96381534 libdm: Introduce dm_malloc_aligned 2018-01-10 15:48:03 +00:00
David Teigland
943b217797 man lvmlockd: remove lv resizing comment 2018-01-10 09:17:57 -06:00
David Teigland
51340888aa lvmlockd: print warning when skipping locking 2018-01-09 11:46:00 -06:00
David Teigland
46cedb105b lvmlockd: add lockopt values for skipping selected locks
and add lockopt to common options.
2018-01-09 11:20:10 -06:00
Alasdair G Kergon
f4675af4cf format_text: Use vgsummary callbacks 2018-01-09 03:14:30 +00:00
Alasdair G Kergon
4b02d4e22e label: Add label_read callback. 2018-01-08 23:30:50 +00:00
Alasdair G Kergon
6d322e68f3 label: Add callback fns (partially) 2018-01-08 17:04:56 +00:00
Alasdair G Kergon
5e7d3ad749 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.
2018-01-06 02:40:12 +00:00
Alasdair G Kergon
946f07af3e metadata: Use a consistent format for callback fn parameters 2018-01-05 14:24:56 +00:00
Alasdair G Kergon
a0ddfad94b metadata: Change the new data processing fns to void.
Move the existing fn return codes into the new structs.
2018-01-05 03:12:22 +00:00
Alasdair G Kergon
c70c9f6565 format_text: Split vgname_from_mda into three pieces. 2018-01-04 21:13:44 +00:00
Alasdair G Kergon
d61b1369d0 format_text: Split out raw_read_mda_header processing 2018-01-04 15:52:59 +00:00
Alasdair G Kergon
139209ef42 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.
2018-01-04 12:25:24 +00:00
Alasdair G Kergon
111a9fcff5 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.
2018-01-03 23:53:00 +00:00
Alasdair G Kergon
5a846e0929 format_text: Split the text import fns into two pieces. 2018-01-03 20:48:02 +00:00