aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-09-18lvm2: Add build for static libdevmapperHEADmastermainMark Salyzyn
Build just enough of the static library libdevmapper to be useful for building external/cryptsetup. Add Android.mk, static Android configuration include/configure.h, NOTICE and MODULE_LICENSE_GPL files. Signed-off-By: Mark Salyzyn <salyzyn@google.com> Bug: 23181629 Bug: 24133481 Change-Id: I3f98cd7261e2d323e8d04a32b342dc66a572606b
2015-09-17WHATS_NEW: commit 6c0b4a2769067048fa144814e298a3272564c475Peter Rajnoha
2015-09-17libdm: file: add proper checks for directory components in dm_create_dirPeter Rajnoha
Also make error messages more consistent: Before this patch: (/run/lock exists and is not a directory) $ pvs /run/lock/lvm: mkdir failed: Not a directory File-based locking initialisation failed. (/run/lock/lvm exists and is not a directory) $ pvs Directory "/run/lock/lvm" not found File-based locking initialisation failed. With this patch applied: (/run/lock exists and is not a directory) $ pvs Existing path /run/lock is not a directory. Failed to create directory /run/lock/lvm. File-based locking initialisation failed (/run/lock/lvm exists and is not a directory) $ pvs Existing path /run/lock/lvm is not a directory. Failed to create directory /run/lock/lvm. File-based locking initialisation failed.
2015-09-17libdm: dev_node: use lstat instead of stat while removing and renaming nodesPeter Rajnoha
When using udev, the /dev/mapper entries are symlinks - fix the code to count with this. This patch also fixes the dmsetup mknodes and vgmknodes to properly repair /dev/mapper content if it sees dangling symlink in /dev/mapper.
2015-09-17libdm: report: make it possible to use blank value as selection for string ↵Peter Rajnoha
list report field $ lvs -o name,tags vg LV LV Tags lvol0 lvol1 mytag Before this patch: $ lvs -o name,tags vg -S 'tags=""' Failed to parse string list value for selection field lv_tags. Selection syntax error at 'tags=""'. Use 'help' for selection to get more help. (and the same for -S 'tags={}' and -S 'tags=[]') With this patch applied: $ lvs -o name,tags vg -S 'tags=""' LV LV Tags lvol0 (and the same for -S 'tags={}' and -S 'tags=[]')
2015-09-16lvmlockd: unlock lv if command fails before lock completesDavid Teigland
If lvmlockd acquires an lv lock for a command, but the command exits before the reply, then the command has not activated the lv and lvmlockd should unlock it. This only applies when the lv was not already locked. (There will always be a chance that the lv lock is held while the lv is not active, i.e. if the command fails in the small window between getting the lv lock and before doing the activation. In that case, rerunning the activation command corrects the inconsistency.) This commit helps by automatically clearing the inconsistency (lv locked by not activated) in the most common case when the lv lock operation is slow to complete and the command is canceled by the user. This commit also adds and cleans up references to the client id in a bunch of log messages, which is useful to follow processing on each independent lock request.
2015-09-15format-text: label: fix missing dev assignment for struct label in ↵Peter Rajnoha
_text_pv_write When using lvm shell, some structures which are cached in memory may be reused. This happens for the struct label (a part of lvmcache_info structure) when lvmetad is used in which case the PV scan is not done that would normally overwrite these label structures in memory and making them up-to-date. This is all consequence of the fact that struct lvmcache_info and struct label are not always assigned in the same part of the code. For example, if lvmetad *is not* used, parts of the struct label are reassigned in label_read fn while struct lvmcache_info is created elsewhere. No part of the code reused struct label (and its "dev" field) before calling label_read fn. That's why the real bug is hidden when using lvm shell without lvmetad. However, with lvmetad and lvm shell, the situation is a bit different. The label_read fn is not called if lvmetad *is* used, hence the struct label may have ended up not initialized properly. There was missing assignment for the dev field in struct label in _text_pv_write fn which caused this problem to appear in lvm shell with lvmetad, for example: Before this patch: lvm> pvcreate /dev/sda Physical volume "/dev/sda" successfully created lvm> pvs /dev/sda PV VG Fmt Attr PSize PFree unknown device lvm2 --- 128.00m 128.00m With this patch applied: lvm> pvcreate /dev/sda Physical volume "/dev/sda" successfully created lvm> pvs /dev/sda PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m Also, this problem had not appeared before changes introduced by commits e1a63905d14cc73352b905c70cb4084b7e521e33 through 3a6f91d7139119bea664050a957cbc21490398bc which, among other things, added proper label field type reporting. Before, label reporting was the same as using struct physical_volume which has its own dev field assigned and so this problem was not exposed.
2015-09-15post-releaseAlasdair G Kergon
2015-09-15pre-releaseAlasdair G Kergon
2015-09-15man: Add all_man Makefile target.Alasdair G Kergon
Use 'make all_man' to generate all man pages (regardless of configuration options) or 'make install_all_man' to install them.
2015-09-14vgcreate: initialize new PVs only in first vg_writeDavid Teigland
When a command does a sequence of vg_write + vg_commit + vg_write + vg_commit, initialization of non-PV devices happens during the first vg_write, and does not need to be repeated by the second vg_write. When creating a lockd VG, this sequence occurs because the VG is first created, then the lockd data is created, then the lockd data is then written to the VG metadata.
2015-09-14tests: early check for snapshot-mergeZdenek Kabelac
2015-09-14tests: lvextend of full thin poolZdenek Kabelac
2015-09-14thin: show message on error pathZdenek Kabelac
Add missing log_error and show proper reason for failure when autoextend is set to 0. Add missing log_error when checked LV is not locally active.
2015-09-14libdm: no validate for pool without messagesZdenek Kabelac
Avoid validation of free space in pool, when no messages are passed. Patch a3c7e326c3e9950fe74e433c406d6e1b5a53bf25 add new check for pool overload - but this check should not be made if there are no messages and transaction_id is still within 'bounds' (bigger by 1).
2015-09-14vgimporeclone: use correct cache dir pathZdenek Kabelac
Commit 00b36ef06acb15c82d7c9b37872753f02c638316 had a typo and missed '{' for shell variable, thus command used slightly different 'tmp' dir name for cache dir (with extra '}'). Such change was unnoticed until a recent fix in persistent filter, lvm2 missed to update cache file when --config was specified. The result was, /tmp dir was accumulating snap.XXXXX} dirs when running vgimportclose script.
2015-09-11tests: wait for sync before deactivationZdenek Kabelac
On slower machine/disk, sync may block udev from reading and may prevent deactivation.
2015-09-11tests: new thin testsZdenek Kabelac
2015-09-11makefiles: distclean missing filesZdenek Kabelac
2015-09-11pool: validate pool_metadata has proper suffixZdenek Kabelac
2015-09-11thin: improve swapping of identifiersZdenek Kabelac
Since we may want to swap names when LVs are complex types, we cannot avoid doing full renames on both LV stacks. Temporarily use 'pvmove_tmeta' as unused name to prevent validation troubles.
2015-09-11thin: lvconvert use passed PVs for _pmspareZdenek Kabelac
When PVs are given on 'lvconvert' respect them when converting volume to thin-pool and allocating i.e. _pmspare.
2015-09-11configure: relocate configure.hZdenek Kabelac
Commit 9403edbb93a2c337df790408e9ff3d26566b7443 move location of configure.h and lvm-version.h. Let's try even better place then /conf dir which should be left for user configurable files. Put these files right into include dir.
2015-09-11configure: correct messageZdenek Kabelac
2015-09-11man lvmlockd: move and update text about vgremoveDavid Teigland
The requirement to stop VGs before vgremove applies to both sanlock and dlm VGs.
2015-09-11lvmlockd: prevent vgremove of dlm VG while lockspace is usedDavid Teigland
This applies the same rule/logic to dlm VGs that has always existed for sanlock VGs. Allowing a dlm VG to be removed while its lockspace was still running on other hosts largely worked, but there were difficult problems if another VG with the same name was recreated. Forcing the VG lockspace to be stopped, gives both sanlock and dlm VGs the same behavior.
2015-09-11lvmlockd: remove shortcut for lockspace thread cleanupDavid Teigland
This shortcut was added for an odd case that I do not believe is relevant any more. Having an alternate path for lockspace thread cleanup is a complication that could lead to problems.
2015-09-11lvmlockd: optimize dlm global lockspace creationDavid Teigland
Set a flag indicating that the dlm global lockspace exists to avoid going through the entire process of trying to add it before finding it exists.
2015-09-11lockd: fix rescanning VG metadataDavid Teigland
The code was expecting the wrong return value from compare_config, which returns 0 when equal. This is a problem for a lockd VG using multiple PVs when the VG needs to be rescanned.
2015-09-10spec: upgradeZdenek Kabelac
Upgrade spec rules to be in touch with recent code. Provide services and proper postin/preun/postun scriplets.
2015-09-10tests: remove only existing loopsZdenek Kabelac
If loop device meanwhile dissapered, skip 'losetup -d' call.
2015-09-10tests: fix check lv_not_existZdenek Kabelac
Use 'not' to set proper 'expected return status' so we do not 'leak' debug logs printed for failing case.
2015-09-10tests: check cache stripe and raid behaviorZdenek Kabelac
Somehow raid tests landed in plain cache - separte them out so they properly check for have_raid. Check we do not support strip option with cache-pool creation.
2015-09-10cache: disallow stripes/size for cache poolZdenek Kabelac
ATM allocation can't handle stripping and cache pool allocation. It's not yet even clear what should be actually result. Until resolved, disable this option (it's been coredumping inside allocation anyway).
2015-09-10cache: warn if caching causes troublesZdenek Kabelac
Certain stacks of cached LVs may have unexpected consequences. So add a warning function called when LV is cached to detect such caces and WARN user about them - the best we could do ATM.
2015-09-10lib: when moving segtypes, move LV bitsZdenek Kabelac
When we insert layer we also move status flag-bits for certain LV types, so internal volume_group structure remains consistent. (Perhaps it's misuse of 'insert_layer' function and we should have another similar function for this.) Basically we aim to maintain the same state as after reading fresh metadata out of volume group. Currently we when i.e. cache 'raid' LV - this should transfer 'raidLV' flag to _corigin LV and cache is no longer a raid. TODO: bits for stacked devices needs more exact rules.
2015-09-10lvmlockd: check all variations of lvb valuesDavid Teigland
The dlm will often lose the lvb content, so we need to check quite a few possibilities for lvb values that were not being checked before. Refactoring was required to pass the entire lvb value back to the core code instead of the single value. The only functional change should be detecting new lvb states where metadata is now invalidated where it wasn't before.
2015-09-10lvmlockd: flag for internal actionsDavid Teigland
When an action is created by lvmlockd for itself, there is no client to send the result to. Add the NO_CLIENT flag to the action to skip sending the result to a client.
2015-09-10lvmlockd: rename ADOPT_CLIENT_IDDavid Teigland
to INTERNAL_CLIENT_ID since it will be used for more than adopting locks.
2015-09-10lockd: add start_init arg to lockd_start_vgDavid Teigland
Add a new arg to lockd_start_vg() that indicates it is being called for a new lockd VG, so that lvmlockd knows the lockspace being started is new. (Will be used by a following commit.)
2015-09-10vgchange: lock-stop only needs shared lockDavid Teigland
lock-stop is one of the vgchange options that doesn't change the VG so we can override the default ex lock and use sh.
2015-09-10dev-cache: ignore persistent cache if configuration changedPeter Rajnoha
Commit f6473baffc2d0b486b2aa941cf2681683026b3a5 introduced a new cmd->initialized variable to keep info about which parts of the cmd_context have been initialized. A part of this patch was also a change in refresh_filters fn which checks for cmd->initialized.filters variable and it does the filter refresh *only* if the filter has already been initialized before otherwise it's a NOOP (before, the refresh_filters also initialized filters as a side effect in case it had not been initialized before which was not quite correct). However, the commit f6473baffc2d0b486b2aa941cf2681683026b3a5 did not handle the case in which configuration changes either via --config argument or when configuration file changed and its timestamp was higher than the timestamp of the persistent cache file - the /etc/lvm/cache/.cache. This patch fixes this issue and it causes the init_filters fn in lvm_run_command fn to be called with proper value of "load_persistent_cache" switch even if the configuration changes, hence causing the persistent cache file to be ignored in this case.
2015-09-09man lvmlockd: fix typoDavid Teigland
2015-09-09man lvmlockd: mention device used for first vgcreateDavid Teigland
2015-09-08tests: ensure dd flushed all data before exitZdenek Kabelac
2015-09-08tests: better check for compiled versionZdenek Kabelac
Use install /lib files to check for expected version.
2015-09-08makefiles: ensure no old .h are leftZdenek Kabelac
Ensure make clean cleans any left-over file from their previous location so they are not in conflict with new ones. Also hide error message when .commands file is not present.
2015-09-08WHATS_NEW: commit b77497cbd86a854add3ffa4ce09a35f165c0d2baPeter Rajnoha
2015-09-08filters: make sure regex filter is evaluated before any filter that needs ↵Peter Rajnoha
disk access The regex filter (controlled by devices/filter lvm.conf setting) was evaluated as the very last filter. However, this is not optimal when it comes to restricting disk access - users define devices/filter as well as devices/global_filter to avoid this. The devices/global_filter is already positioned at the beginning of the filter chain. We need to do the same for devices/filter. Filter chains before this patch: A: when lvmetad is not used: persistent_filter -> sysfs_filter -> global_regex_filter -> type_filter -> usable->filter -> mpath_component_filter -> partition_filter -> md_component_filter -> fw_raid_filter -> regex_filter B: when lvmetad is used: B1: to update lvmetad: sysfs_filter -> global_regex_filter -> type_filter -> usable_filter -> mpath_component_filter -> partition_filter -> md_component_filter -> fw_raid_filter B2: to retrieve info from lvmetad: persistent_filter -> usable_filter -> regex_filter From the chain list above we can see that particularly in case when lvmetad is not used, the regex filter is the very last one that is processed. If lvmetad is used, it doesn't matter much as there's the global_regex_filter which is used instead when updating lvmetad and when retrieving info from lvmetad, putting regex_filter in front of usable_filter wouldn't change much since usabled_filter is not reading disks directly. This patch puts the regex filter to the front even in case lvmetad is not used, hence reinstating the state as it was before commit a7be3b12dfe7388d1648595e6cc4c7a1379bb8a7 (which moved the regex_filter position in the chain). Still, the arguments for the commit a7be3b12dfe7388d1648595e6cc4c7a1379bb8a7 still apply and they're still satisfied since component filters (MD, mpath...) are evaluated first just before updating lvmetad. So with this patch, we end up with: A: when lvmetad is not used: persistent_filter -> sysfs_filter -> global_regex_filter -> regex_filter -> type_filter -> usable->filter -> mpath_component_filter -> partition_filter -> md_component_filter -> fw_raid_filter B: when lvmetad is used: B1: to update lvmetad: sysfs_filter -> global_regex_filter -> type_filter -> usable_filter -> mpath_component_filter -> partition_filter -> md_component_filter -> fw_raid_filter B2: to retrieve info from lvmetad: persistent_filter -> regex_filter -> usable_filter This way, specifying the regex_filter in non-lvmetad case causes the devices to be filtered based on regex first before processing any other filters which can access disks (like md_component_filter). This patch also streamlines the code for better readability.
2015-09-08tests: skip raid testing on 4.[1,2] fc24 kernelsZdenek Kabelac
Hopefull 4.3 will be fixed and test will be updated to let raid test running again. Meanwhile using md-raid may effectively kill kernel, so leave at least other tests running.