summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* command: populate lvmetad at startupdev-dct-lvmetad-bakDavid Teigland2015-10-151-0/+5
|
* lvmetad: return token value with global stateDavid Teigland2015-10-151-3/+4
|
* lvmetad: add debug linesDavid Teigland2015-10-151-0/+6
|
* lvmcache: change log_verbose to log_warnDavid Teigland2015-10-151-3/+3
|
* fix prev "warn about all duplicate PVs in command"David Teigland2015-10-151-9/+0
|
* lvmetad: skip replacing unchanged metadataDavid Teigland2015-10-151-0/+14
|
* pvscan: --cache should scan all devicesDavid Teigland2015-10-154-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running pvscan --cache, the intention is to scan all devices, i.e. the equivalent of running 'pvscan --cache dev' for each device. But, some devices holding duplicate PVs were being skipped, and lvmetad was not being told about them. This was a side effect of the fact that the lvmcache layer is used internally during scanning (it's used to transfer info between the different stages of the command: label reading, vg reading, sending the vg.) An unwanted side effect of using lvmcache is that it eliminates duplicate PVs if it sees them. This prevented the command from sending some duplicate PVs to lvmetad (when the first duplicate was preferred over the second.) The fix is to drop the lvmcache state between scanning each PV. There is no need to keep any cache state between each PV being scanned (there's nothing being reused), and the unneeded state is causing lvmcache to eliminate duplicates which is harmful for pvscan --cache. Also, remove clvm locking from pvscan_lvmetad. This is not needed since lvmetad cannot be used with clvm. It was interfering with clearing the cache.
* lvmetad: warn about all duplicate PVs in commandDavid Teigland2015-10-151-3/+17
| | | | | | | When the command gets a list of alternate devices from lvmetad, warn about them all directly. This is not the same as the warnings when adding lvmcache, which are related to which duplicate is preferred.
* lvmetad: rewrite update codeDavid Teigland2015-10-141-283/+1428
| | | | | | | | | | | | update_metadata and pv_found update the cached metadata; rewrite both of these to improve the code, make it much more clear what they do, more thoroughly cover possible combinations/transitions, add more error checking and handling, add comments. The values stored in hash table entries also changed to be independent of each other, i.e. separately allocated. Other functions are changed to match this.
* lvmetad: fix update_metadata with new vgidDavid Teigland2015-10-141-0/+13
| | | | | | | | | | | | | | | | | | | When vgchange -u changes the vgid in an existing VG, it invokes update_metadata() in lvmetad with the existing VG name but a new vgid. update_metadata() doesn't recognize this condition, and ends up with in correct state, e.g. the existing name is missing in the vgname_to_vgid hash table. This fixes update_metadata() to recognize when an existing VG name is being updated with a new vgid, and in that case first calls remove_metadata() on the old vgid, before continuing with update_metadata() which will add the updated VG as if it were new. One known shortcoming of this approach is that the VG is missing from lvmetad hash tables completely in the short time between the remove and adding it again. Other commands that look up the VG in that window will not find it.
* lvmlockd: use flag to avoid blocking in sanlock_acquireDavid Teigland2015-10-141-0/+29
| | | | | | | | | | | | If a host failed while holding a sanlock lease, sanlock_acquire will by default block and wait for the lease to expire before returning. We want it to return with an error so we can retry instead of blocking, which allows us to process other lock operations. (Enclose this in an ifdef until the new flag appears in a sanlock release.)
* dmeventd: use matching functionZdenek Kabelac2015-10-141-1/+7
| | | | | | Respect lvm2_log_fn prototype. The idea of 'reusing' print_log with plain cast is causing very strange crashes with some older 'gcc' compilers. So just do it cleanly...
* thin: enforce local activation when creation new thinZdenek Kabelac2015-10-141-6/+13
| | | | | As we need to check how full thin-pool is - require thin-pool is locally active.
* makefiles: switch to rpath-linkZdenek Kabelac2015-10-141-2/+2
| | | | | Plain rpath is to invasive and gets into binary. We only want to provide hint for linker.
* dmeventd: fix missing '!'Zdenek Kabelac2015-10-131-1/+1
| | | | During recent code changes '!' was badly converted.
* makefiles: older gcc needs hint with rpathZdenek Kabelac2015-10-131-0/+3
| | | | | gcc 4.3 seems not to be able to find linked library without specifying -rpath to linker (plain -L) is not enough.
* dmeventd: compilable without DEBUG CFLAGZdenek Kabelac2015-10-131-3/+6
| | | | Missed compilability without DEBUG.
* Revert "log: no file for external logging"Alasdair G Kergon2015-10-132-5/+0
| | | | | | | | This reverts commit 1b1c01a27b359f8e91c3c9e08684c435d8fd51c2. This caused messages to get dropped instead of logged into the log file. (The log file and log function are independent at the moment.)
* tests: more extend testingZdenek Kabelac2015-10-131-4/+47
|
* tests: wait for initial syncZdenek Kabelac2015-10-131-0/+1
| | | | Raid should be in-sync ATM for any gaming.
* tests: start logging dmeventd outputZdenek Kabelac2015-10-131-1/+1
| | | | | Log dmeventd output from test - keep output logging in test and avoid sending messages to syslog.
* tests: better regex checkZdenek Kabelac2015-10-131-1/+1
| | | | Enhance check for matching prefix.
* tests: show status in in_syncZdenek Kabelac2015-10-131-11/+14
| | | | | Make visible actual status line when returing 'raid' is in sync. Useful to prove when kernel is wrong.
* makefiles: src dirs have depth 5Zdenek Kabelac2015-10-131-1/+1
| | | | For tags generation scan depth 5.
* makefiles: drop explicit linkingZdenek Kabelac2015-10-131-5/+0
| | | | Nothing in /sscripts needs devmapper-event library so drop its linking.
* makefiles: generate LocalZdenek Kabelac2015-10-131-1/+3
| | | | | | | | | | Use same exported symbols list for other generated symfile as it appeared to be the right way for libdm. Local { local: *; };
* dmeventd: rework raid pluginZdenek Kabelac2015-10-132-88/+29
| | | | | Switch to per-thread mem-pool and lock only for lvm2 calls. Use libdm parser for raid status line.
* dmeventd: less locking mirrorZdenek Kabelac2015-10-132-24/+10
| | | | | Rework mirror plugin to use per-thread mem-pool. This allows to use locking only for lvm2 library calls.
* dmeventd: less locking for snapshot and thinZdenek Kabelac2015-10-133-17/+11
| | | | | | | Use lvm lock for lvm library calls. dm functions in-use are 'thread-safe' since we use local per-thread mem pool.
* dmeventd: add local mempool for raid and mirrorZdenek Kabelac2015-10-133-6/+62
| | | | Using local mempools allows to drop locks when such memory is needed.
* dmeventd: use new macros to init mempoolZdenek Kabelac2015-10-132-34/+18
| | | | | For thin and snapshot use new macros to simplify mempool init and destroy
* dmeventd: introduce macro for initZdenek Kabelac2015-10-131-1/+33
| | | | Simplify commonly used pool creation.
* dmeventd: new initialization of plugin threadsZdenek Kabelac2015-10-132-85/+86
| | | | | | | | | | | | Rework thread creation code to better use resources. New code will not leak 'timeout' registered thread on error path. Also if the thread already exist - avoid creation of thread object and it's later destruction. If the race is noticed during adding new monitoring thread, such thread is put on cleanup list and -EEXIST is reported.
* cleanup: typo in commentZdenek Kabelac2015-10-131-1/+1
|
* cleanup: move system defines before structsZdenek Kabelac2015-10-131-12/+10
|
* cleanup: avoid using privateZdenek Kabelac2015-10-134-18/+18
| | | | Switch private to user.
* cleanup: remove multilogZdenek Kabelac2015-10-131-6/+0
|
* cleanup: always set nsecZdenek Kabelac2015-10-131-1/+1
|
* cleanup: more readable codeZdenek Kabelac2015-10-132-6/+3
|
* dmeventd: support logging on stdoutZdenek Kabelac2015-10-132-7/+33
| | | | | | Add new supported option '-l' log to stdout/stderr. It has to be paired with '-f' (foreground run).
* cleanup: static with _Zdenek Kabelac2015-10-131-8/+9
| | | | Document ? is printing to stderr.
* dmeventd: handle snapshot overflowZdenek Kabelac2015-10-132-2/+3
| | | | | When snapshot reports overflow, handle it in the same way as Invalid. Until better ideas are implemented.
* man: dmeventd updateZdenek Kabelac2015-10-131-27/+65
|
* dmeventd: add more debug messagesZdenek Kabelac2015-10-133-3/+17
|
* dmeventd: drop changing loggingZdenek Kabelac2015-10-131-10/+0
| | | | | | | As we now use 'unified' logging macro system - we no longer need to protect from change of logging function pointer - it's set once at the start of dmeventd and not change anymore (as lvm2 library no longer interferers here).
* dmeventd: enable new loggingZdenek Kabelac2015-10-131-2/+1
|
* dmeventd: enable new loggingZdenek Kabelac2015-10-131-29/+11
|
* dmeventd: use log_ macros in pluginsZdenek Kabelac2015-10-135-68/+23
| | | | Convert from syslog to standard log_() macros in plugins.
* dmeventd: syslog -> log_xxxxxZdenek Kabelac2015-10-138-157/+145
| | | | Convert logging of dmeventd to libdm logging macros.
* libdmevent: add dm_event_logZdenek Kabelac2015-10-132-3/+99
| | | | | Add dm_event_log() logging function. Controled by dm_event_log_set().