summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Improve checks for non-lvmlockd casedev-dct-lvmlockd-ATDavid Teigland2015-06-243-23/+87
|
* Add lvmlockdDavid Teigland2015-06-2483-129/+14680
|
* libdaemon: add comment about using main and initDavid Teigland2015-06-241-0/+5
|
* tests: workaround udev problemZdenek Kabelac2015-06-241-0/+5
| | | | | If udev has not removed 'dir' entry - just issue TEST WARNING, clear dir, but do not fail whole rest of test.
* snapshot: add synchronization pointZdenek Kabelac2015-06-242-0/+4
| | | | | | | | | | | | | | Synchronize with udev logic before reusing device as snapshot. This patch tries to fix the problem with udev, where we manage to 'active' LV for clearing, then we deactivate such device and active again as member of 'origin&snapshot' tree all in 1 step. There needs to be a sync point where udev has time to remove all links, otherwise we race with scans and we may end-up with mysterious 'free' links in the system pointing to wrong dm names. This patch tries to fix failing topology cluster tests..
* commands: --withspaces also for config and lvmconfig cmd aliasesPeter Rajnoha2015-06-241-2/+4
|
* make: use lvmconfig ... --withspaces when generating lvm.conf and lvmlocal.confPeter Rajnoha2015-06-241-2/+2
|
* lvmconfig: add --withspaces optionPeter Rajnoha2015-06-247-4/+18
| | | | | | | | | | We shouldn't be adding spaces by default in output as that may be be used already in scripts and especially for the eval in shell scripts where spaces are not allowed between key and value! Add --withspaces option to lvmconfig for pretty output with more space in for readability.
* WHATS_NEW: recent commits - config value format flagsPeter Rajnoha2015-06-241-0/+3
|
* config: regenerate configure.in to accomodate all recent changesPeter Rajnoha2015-06-242-38/+45
| | | | Hopefully closer to the ideal.
* config: devices/filter and devices/global_filter setting have 'a/.*/' as ↵Peter Rajnoha2015-06-241-2/+2
| | | | default value
* config: allow empty values for {thin,cache}_{check,repair}_optionsPeter Rajnoha2015-06-241-4/+4
| | | | | | It's not an error to define empty values for {thin,cache}_{check,repair}_options - such empty value means no options are passed when these external commands are called.
* configure: add DEFAULT_USE_BLKID_WIPINGPeter Rajnoha2015-06-244-3/+23
| | | | | | | | | If blkid wiping is possible, than set use_blkid_wiping=1 and use_blkid_wiping=0 otherwise for its default value. If blkid wiping is disabled during configure and use_blkid_wiping=1 is set by chance, it's simply ignored - this patch is just a cleanup that makes it more obvious for the user (we use similar logic for use_lvmetad and use_lvmpolld settings).
* config: display global/umask in octal formPeter Rajnoha2015-06-241-1/+1
|
* config: use proper unconfigured default values for use_lvmetad and ↵Peter Rajnoha2015-06-241-2/+2
| | | | | | | | | | | | | | | | use_lvmpolld settings Default value for lvmetad and lvmpolld has hooks in configure script, the "lvmconfig --type default --unconfigured" should display: use_lvmetad = @DEFAULT_USE_LVMETAD@ use_lvmpolld = @DEFAULT_USE_LVMPOLLD@ Note that these settings are not of string type. Recent change (the DM_CONFIG_VALUE_FMT_STRING_NO_QUOTES formatting flag) makes it possible to recognize that the setting is not of string type and if there's unconfigured value defined for it, the enclosing " " is automatically removed on output.
* config: cleanup default values for some configuration settings with array valuesPeter Rajnoha2015-06-242-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Do not use "#S" (blank string) as default value as that ends up with 'key = [ "" ]' to be generated which is not what we want in most cases. Also, fix default values for global/{thin,cache}_{check,repair}_options and avoid assigning blank values. For example, the thin_check_options had this set as default value previously: "#S" DEFAULT_THIN_CHECK_OPTION1 "#S" DEFAULT_THIN_CHECK_OPTION2 If any (or both) of DEFAULT_THIN_CHECK_OPTION* variables was set to "", we ended up with clumsy default value generated like: thin_check_options = [ "-q", "" ] With this patch, we end up with correct: thin_check_options = [ "-q" ] or, if all options are undefined: thin_check_options = [ ] Which is the correct way to express this.
* config: add support for config value formatting flagsPeter Rajnoha2015-06-246-15/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two basic groups of formatting flags (32 bits): - common ones applicable for all config value types (lower 16 bits) - type-related formatting flags (higher 16 bits) With this patch, we initially support four new flags that modify the the way the config value is displayed: Common flags: ============= DM_CONFIG_VALUE_FMT_COMMON_ARRAY - causes array config values to be enclosed in "[ ]" even if there's only one item (previously, there was no way to recognize an array with one item and scalar value, hence array values with one member were always displayed without "[ ]" which libdm accepted when reading, but it may have been misleading for users) DM_CONFIG_VALUE_FMT_COMMON_EXTRA_SPACE - causes extra spaces to be inserted in "key = value" (or key = [ value, value, ... ] in case of arrays), compared to "key=value" seen on output before. This makes the output more readable for users. Type-related flags: =================== DM_CONFIG_VALUE_FMT_INT_OCTAL - prints integers in octal form with "0" as a prefix (libdm's config reading code can handle this via strtol just fine so it's properly recognized as number in octal form already if there's "0" used as prefix) DM_CONFIG_VALUE_FMT_STRING_NO_QUOTES - makes it possible to print strings without enclosing " " This patch also adds dm_config_value_set_format_flags and dm_config_value_get_format_flags functions to set and get these formatting flags.
* libdaemon: allow main processing function to be specifiedDavid Teigland2015-06-232-1/+8
|
* doc: mention new invalid states in lvmetad_designDavid Teigland2015-06-231-0/+11
|
* Reread global state the lvmetad copy is staleDavid Teigland2015-06-232-0/+298
| | | | | | | | | | | This is the client side handling of the global_invalid state added to lvmetad in commit c595b50cec8a6b95c6ac4988912d1412f3cc0237. The function added here: . checks if the global state in lvmetad is invalid . if so, scans disks to update the state in lvmetad . clears the global_invalid flag in lvmetad . updates the local udev db to reflect any changes
* Reread a VG if the lvmetad copy is staleDavid Teigland2015-06-231-0/+106
| | | | | | | and update the lvmetad copy after it is reread from disk. This is the client side handling of the vg_invalid state added to lvmetad in commit c595b50cec8a6b95c6ac4988912d1412f3cc0237.
* lvmetad: add invalidation methodDavid Teigland2015-06-231-1/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to invalidate global or individual VG metadata. The invalid state is returned to lvm commands along with the metadata. This allows lvm commands to detect stale metadata from the cache and reread the latest metadata from disk (in a subsequent patch.) These changes do not change the protocol or compatibility between lvm commands and lvmetad. Global information ------------------ Global information refers to metadata that is not isolated to a single VG , e.g. the list of vg names, or the list of pvs. When an external system, e.g. a locking system, detects that global information has been changed from another host (e.g. a new vg has been created) it sends lvmetad the message: set_global_info: global_invalid=1. lvmetad sets the global invalid flag to indicate that its cached data is stale. When lvm commands request information from lvmetad, lvmetad returns the cached information, along with an additional top-level config node called "global_invalid". This new info tells the lvm command that the cached information is stale. When an lvm command sees global_invalid from lvmated, it knows it should rescan devices and update lvmetad with the latest information. When this is complete, it sends lvmetad the message: set_global_info: global_invalid=0, and lvmetad clears the global invalid flag. Further lvm commands will use the lvmetad cache until it is invalidated again. The most common commands that cause global invalidation are vgcreate and vgextend. These are uncommon compared to commands that report global information, e.g. vgs. So, the percentage of lvmetad replies containing global_invalid should be very small. VG information -------------- VG information refers to metadata that is isolated to a single VG, e.g. an LV or the size of an LV. When an external system determines that VG information has been changed from another host (e.g. an lvcreate or lvresize), it sends lvmetad the message: set_vg_info: uuid=X version=N. X is the VG uuid, and N is the latest VG seqno that was written. lvmetad checks the seqno of its cached VG, and if the version from the message is newer, it sets an invalid flag for the cached VG. The invalid flag, along with the newer seqno are saved in a new vg_info struct. When lvm commands request VG metadata from lvmetad, lvmetad includes the invalid flag along with the VG metadata. The lvm command checks for this flag, and rereads the VG from disk if set. The VG read from disk is sent to lvmetad. lvmetad sees that the seqno in the new version matches the seqno from the last set_vg_info message, and clears the vg invalid flag. Further lvm commands will use the VG metadata from lvmetad until it is next invalidated.
* tests: use vgscan after enable_devZdenek Kabelac2015-06-231-2/+6
| | | | | | | | | | Since our test environment runs also in non-real-udev world, it's using /etc/.cache file with scanned files. So in this case it is mandatory the user runs 'vgscan' after a device reappears in the system. This 'first' lvm2 command then fixes metadata (just like vgs did).
* tests: skip when snapshot does not workZdenek Kabelac2015-06-231-0/+2
| | | | | Some older kernel (i.e. 3.11.10 on fc20) do not work properly. Skip the test if snapshot does not meet 50%.
* tests: newer version needed for ext-origZdenek Kabelac2015-06-231-1/+3
|
* cleanup: avoid printing gcc warningZdenek Kabelac2015-06-232-3/+7
| | | | | Casting to (void) with gcc doesn't remove unused_result warning. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509
* post-releaseAlasdair G Kergon2015-06-204-2/+8
|
* pre-releasev2_02_122Alasdair G Kergon2015-06-204-8/+11
|
* tests: external origin updatesZdenek Kabelac2015-06-192-3/+9
| | | | | Update test for recent updates to support unalligned sizes and extension of reduced volume.
* log: flush stdout before print to stderrZdenek Kabelac2015-06-191-0/+2
| | | | Keep logging readable and fflush stdout before printing to stderr.
* lvm: move hyphen mangling codeZdenek Kabelac2015-06-193-25/+25
| | | | | | | Relocate hyphen code from lvm main into lvm_run_command() so all command and library user will have it. Update WHATS_NEW with missing changes.
* display: drop allocation from display_lvnameZdenek Kabelac2015-06-183-2/+20
| | | | | | | | | | | | | Use of display_lvname() in plain log_debug() may accumulate memory in command context mempool. Use instead small ringbuffer which allows to store cuple (10 ATM) names so upto 10 full names can be used at one. We are not keeping full VG/LV names as it may eventually consume larger amount of RAM resouces if vgname is longer and lots of LVs are in use. Note: if there would be ever needed for displaing more names at once, the limit should be raised (e.g. log_debug() would need to print more then 10 LVs on a single line).
* thin: support unaligned size of external origin and thin poolZdenek Kabelac2015-06-184-8/+102
| | | | | | | | | With thin-pool kernel target module 1.13 it's now support usage of external origin with sizes which are not 'alligned' with chunk size of thin-pool. Enable lvm2 support for this and also fix reporting of data_percent usage for case sizes are not alligned.
* thin: drop limitation for extension of reduced thin volumeZdenek Kabelac2015-06-182-10/+1
| | | | | | Drop check which has prevented resize of reduce thin volume with external origin. User is supposed to use 'zeroing' to get 'clean' chunks.
* libdm: add dm_tree_node_set_thin_pool_read_onlyZdenek Kabelac2015-06-184-1/+22
| | | | | Support thin-pool tree node with activation in read-only mode. (Native kernel API).
* libdaemon: move compare_config to libDavid Teigland2015-06-173-57/+59
| | | | so it can be used elsewhere.
* cleanup: missing target_type check in device_is_usable filterPeter Rajnoha2015-06-171-1/+1
|
* cleanup: || instead of |Peter Rajnoha2015-06-171-2/+2
| | | | More efficient with same result here.
* filter: filter-usable: consider snapshot and origin LV as unusable if its ↵Peter Rajnoha2015-06-172-7/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | component is suspended Note that this is just a quick fix and it needs more robust fix to encompass any combination, not just the (old) snapshot one! This started with this report: https://bugzilla.redhat.com/show_bug.cgi?id=1219222 If we have devices/ignore_suspended_devices=1 set based on which we filter out suspended devices as unusable (or if we ignore suspended devices by force, e.g. during lvconvert called from dmeventd) and when we have snapshot and snapshot origin devices in the play, we need to look at their components unerneath (*-real and *-cow) to check if they're not suspended. If they are, the snapshot/snapshot origin is not usable as well and hence it needs to be filtered out by filter-usable.c code which does suspended device filtering. Not going into much details here, more details are in the bugzilla mentioned above. However, this is a quick fix since snapshot and this exact situation is not the only one. So this is something that needs to be revisited and fixed properly with full dm tree and checking the whole stack to state whether the device at the very top is usable or not.
* config: fix some settings incorrectly marked as CFG_DEFAULT_COMMENTED ↵Peter Rajnoha2015-06-172-26/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of CFG_DEFAULT_UNDEFINED and causing segfault This patch fixes segfault which was caused by incorrectly marking some settings CFG_DEFAULT_COMMENTED instead of CFG_DEFAULT_UNDEFINED - the ones which have NULL default value, hence they're really undefined. A regression caused by a98ceceb1d101f0b19a6115f406e23f13feab5ae. For example: $ lvmconfig log/file file="/a" Before this patch: $ lvmconfig --type diff Segmentation fault (core dumped) With this patch applied: $ lvmconfig --type diff log { file="/a" } The same applies for these settings: log/activate_file global/library_dir global/system_id_file <disk_area>/disk_area_id There were also other settings with NULL default value and marked as CFG_DEFAULT_COMMENTED instead of CFG_DEFAULT_UNDEFINED, but they were cfg_array config settings where the NULL value was not causing segfault (NULL == empty array).
* Add a global get_cmd_name()David Teigland2015-06-162-0/+6
| | | | Which returns the string set by set_cmd_name().
* lv_refresh: move the bulk of the function into libdev-dct-nextDavid Teigland2015-06-163-16/+26
| | | | So that it can be used from other lib code.
* man vgchange lvchange: mention activation option sDavid Teigland2015-06-162-18/+68
| | | | | and improve the existing text about existing activation options.
* man lvm: mention hyphens in option namesDavid Teigland2015-06-161-0/+4
|
* Add the 's' activation modeDavid Teigland2015-06-163-2/+11
| | | | | | | | | | | | | Just as 'e' means activation with an exclusive lock, add an 's' to mean activation with a shared lock. This allows the existing but implicit behavior of '-ay' of clvm LVs to be specified explicitly. For local VGs, asy simply means ay, just like aey means ay. For local VGs, ay == aey == asy For clvm VGs, ay == asy, aey == aey, asy == asy
* Ignore hyphens in long option namesDavid Teigland2015-06-162-1/+26
| | | | | | | | | | | | | | The hyphens are removed from long option names before being read. This means that: - Option name specifications in args.h must not include hyphens. (The hyphen in 'use-policies' is removed.) - A user can include hyphens anywhere in the option name. All the following are equivalent: --vgmetadatacopies, --vg-metadata-copies, --v-g-m-e-t-a-d-a-t-a-c-o-p-i-e-s-
* xlate: add new variantsDavid Teigland2015-06-161-19/+63
| | | | New variants use the clearer function names from the kernel.
* lvmcache: mention lvconvert --cachemodeDavid Teigland2015-06-151-0/+5
| | | | for changing the cache mode on an existing LV.
* debug: better tracing messagesZdenek Kabelac2015-06-152-2/+8
| | | | Enhance traced output.
* libdm: better debug messageZdenek Kabelac2015-06-152-3/+6
| | | | Print reason for failing ioctl if thin pool message fails.