summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvm2_activation_generator: don't create full context for liblvm2appdev-dct-config-contextDavid Teigland2016-05-171-9/+3
| | | | | | | | | | Don't create a full lvm command context with lvm_init() which does a lot of command setup (like connecting to daemons), which is unnecessary for simply reading a value from lvm.conf. Passing a NULL context arg to the lvm_config_ function is now allowed, in which case lvm.conf is read without doing lvm command setup.
* liblvm: allow config settings to be read without full lvm cmdDavid Teigland2016-05-173-3/+71
| | | | | | | | | | A program may be using liblvm2app for simply checking a config setting in lvm.conf. In this case, a full lvm context is not needed, only cmd->cft. lvm_config_find_bool() can now be passed a NULL lvm context in which case it will only create cmd->cft, check the config setting, and destroy the cmd.
* pvremove: allow clearing a duplicate PVDavid Teigland2016-05-163-2/+58
| | | | | Add a special case to allow modifying a duplicate PV to erase it with pvremove -ff.
* lvmetad: remove old thread lockingDavid Teigland2016-05-161-211/+3
| | | | | The old thread locking is very fine grained and complex, and appears to have no concurrency advantage.
* lvmetad: add request level thread lockingDavid Teigland2016-05-161-28/+75
| | | | | Use an rwlock for requests that read/write cache state. Use a mutex for requests that read/write global info.
* python: move lvm_initDavid Teigland2016-05-161-11/+6
| | | | | | | | | | | | Only call lvm_init() when it's needed so that simply loading the lvm python code in another program doesn't make that program do lvm initialization. The version call doesn't need a handle. The garbage collection can just do lvm_quit to destroy the command. The next call that needs lvm_init will do it first.
* post-releaseAlasdair G Kergon2016-05-144-2/+8
|
* pre-releasev2_02_154Alasdair G Kergon2016-05-144-6/+8
|
* lib: fix init error handlingDavid Teigland2016-05-122-4/+1
| | | | | | | | | | | | | | When setting up a toolcontext, the lib init function was detecting an error when there was none, and then it was returning an incompletely initialized cmd struct instead of NULL. The effect was that the lib would try to use the uninitialized cmd struct and segfault. This would happen if a non-fatal error occurred during cmd setup, e.g. user permission failed on lvmetad socket, causing cmd to fall back to scanning and not use lvmetad. The only real error condition is when create_toolcontext returns NULL. If cmd is returned, the lib can use it.
* lvmetad: Fix client error when socket access fails.Alasdair G Kergon2016-05-121-1/+1
|
* libdm: Show lib vsn even if driver vsn unavailable.Alasdair G Kergon2016-05-122-1/+2
|
* device: Retry open without O_NOATIME if it fails.Alasdair G Kergon2016-05-123-1/+14
|
* test: process-each-duplicate-pvsDavid Teigland2016-05-111-0/+5
| | | | | skip on RHEL5 where DEV_USED_FOR_LV doesn't work because it depends on a newer bit of sysfs.
* refactor: separate original _report fn into _report and _do_report fnPeter Rajnoha2016-05-101-188/+215
| | | | | | | | | | The _report fn is getting big - separate it in two: - _report fn to get all the options and arguments - _do_report fn for reporting itself Also, place all the variables/arguments in one structure for easier handling of the variables around.
* post-releaseAlasdair G Kergon2016-05-074-2/+8
|
* pre-releasev2_02_153Alasdair G Kergon2016-05-075-7/+17
|
* activation: activation check is mandatoryZdenek Kabelac2016-05-061-3/+4
| | | | | Make missing activation() check before calling target_persent an INTERNAL_ERROR.
* cleanup: drop tracingZdenek Kabelac2016-05-061-1/+1
| | | | When activation is disabled, avoid tracing it in cache target.
* segtype: check for activation2Zdenek Kabelac2016-05-061-0/+3
| | | | | Previous patch 8857b227645e97b7cb52ae8d007e87e07db58b4e missed to check for activation for raid target.
* WHATS_NEW: duplicate PVsDavid Teigland2016-05-061-0/+6
|
* metadata: move warning message about repairing VGDavid Teigland2016-05-061-3/+2
| | | | | | Move the message to just before the repair is going to happen to avoid printing the message in cases where repair is skipped.
* test: vgcfgbackup-lvm1David Teigland2016-05-061-0/+36
| | | | The lvm1 part of vgcfgbackup-usage.
* test: vgcfgbackup-usageDavid Teigland2016-05-061-14/+0
| | | | Split the lvm1 part into a separate test.
* test: vgsplit-usageDavid Teigland2016-05-061-1/+14
| | | | | | Restart clvmd between testing each mdatype to avoid a problem with dev state being kept from one test to the next.
* test: lvmetad-ambiguousDavid Teigland2016-05-061-5/+5
| | | | update for duplicate changes
* test: pv-duplicate-uuidDavid Teigland2016-05-061-6/+28
| | | | update for duplicate changes
* test: process-each-duplicate-pvsDavid Teigland2016-05-061-114/+476
| | | | Update for new duplicate processing.
* lvmetad: add duplicate resolution adviceDavid Teigland2016-05-061-0/+7
|
* lvmetad: disable if device scan failsDavid Teigland2016-05-063-15/+23
| | | | | | | | If a command begins repopulating the lvmetad cache, and fails part way through, it should set the disabled state in lvmetad so other commands don't use bad data. If a subsequent scan succeeds, the disabled state is cleared.
* lvmcache: use active LVs and device sizes to choose between duplicatesDavid Teigland2016-05-061-14/+76
| | | | | | | | If duplicate devices exist for a PV, and one device's size matches the PV size, but the other doesn't, then prefer the matching device. If one device is used by an active LV, prefer that device.
* pvs: new attr and field for unchosen duplicate deviceDavid Teigland2016-05-068-3/+39
| | | | | | | | | | | | When there are duplicate devices for a PV, one device is preferred and chosen to exist in the VG. The other devices are not used by lvm, but are displayed by pvs with a new PV attr "d", indicating that they are unchosen duplicate PVs. The "duplicate" reporting field is set to "duplicate" when the PV is an unchosen duplicate, and that field is blank for the chosen PV.
* lvmcache: process duplicate PVs directlyDavid Teigland2016-05-066-124/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, duplicate PVs were processed as a side effect of processing the "chosen" PV in lvmcache. The duplicate PV would be hacked into lvmcache temporarily in place of the chosen PV. In the old way, we had to always process the "chosen" PV device, even if a duplicate of it was named on the command line. This meant we were processing a different device than was asked for. This could be worked around by naming multiple duplicate devs on the command line in which case they were swapped in and out of lvmcache for processing. Now, the duplicate devs are processed directly in their own processing loop. This means we can remove the old hacks related to processing dups as a side effect of processing the chosen device. We can now simply process the device that was named on the command line. When the same PVID exists on two or more devices, one device is preferred and used in the VG, and the others are duplicates and are not used in the VG. The preferred device exists in lvmcache as usual. The duplicates exist in a specical list of unused duplicate devices. The duplicate devs have the "d" attribute and the "duplicate" reporting field displays "duplicate" for them. 'pvs' warns about duplicates, but the formal output only includes the single preferred PV. 'pvs -a' has the same warnings, and the duplicate devs are included in the output. 'pvs <path>' has the same warnings, and displays the named device, whether it is preferred or a duplicate.
* lvmcache: improve duplicate PV handlingDavid Teigland2016-05-066-222/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wait to compare and choose alternate duplicate devices until after all devices are scanned. During scanning, the first duplicate dev is kept in lvmcache, and others are kept in a new list (_found_duplicate_devs). After all devices are scanned, compare all the duplicates available for a given PVID and decide which is best. If the dev used in lvmcache is changed, drop the old dev from lvmcache entirely and rescan the replacement dev. Previously the VG metadata from the old dev was kept in lvmcache and only the dev was replaced. A new config setting devices/allow_changes_with_duplicate_pvs can be set to 0 which disallows modifying a VG or activating LVs in it when the VG contains PVs with duplicate devices. Set to 1 is the old behavior which allowed the VG to be changed. The logic for which of two devs is preferred has changed. The primary goal is to choose a device that is currently in use if the other isn't, e.g. by an active LV. . prefer dev with fs mounted if the other doesn't, else . prefer dev that is dm if the other isn't, else . prefer dev in subsystem if the other isn't If neither device is preferred by these rules, then don't change devices in lvmcache, leaving the one that was found first. The previous logic for preferring a device was: . prefer dev in subsystem if the other isn't, else . prefer dev without holders if the other has holders, else . prefer dev that is dm if the other isn't
* lvmetad: remove client side altdev codeDavid Teigland2016-05-063-85/+2
| | | | | | This is no longer used since lvmetad no longer keeps track of alternate devices for duplicate PVs, but is simply disabled when duplicates appear.
* lvmetad: set disabled flag when duplicate PVs are seenDavid Teigland2016-05-061-152/+31
| | | | | | | | | | | | | | | | When duplicate PVs are detected, set the disabled flag so that commands will disable use of lvmetad. This duplicate detection is done by lvmetad itself when it's told about a single new PV with a PVID that matches an existing PV on another device. (This is different from the case where the command is scanning all devices and detects the duplicate.) Remove the "altdev" logic that attempted to keep track of multiple devices for a single PV. It is no longer used since lvmetad is disabled in this case.
* lvmetad: set disabled flag in lvmetad if duplicate PVs are foundDavid Teigland2016-05-062-0/+144
| | | | | When devices are being scanned, if duplicate PVs are seen, tell lvmetad to set its disabled flag because of duplicate PVs.
* pvscan: fix errors for single dev scan while lvmetad is disabledDavid Teigland2016-05-061-0/+13
| | | | | While lvmetad was disabled, 'pvscan --cache dev' would produce confusing error messages.
* tests: do not use EPOCH for get wrapperZdenek Kabelac2016-05-051-0/+1
| | | | Avoid poluting filesystem with debug.log_DEBUG for get wrapper
* tests: update aux raid supportZdenek Kabelac2016-05-051-1/+4
| | | | | | | | | | | | For raid1 use chunksize as bitmap-chunk specification. Always enforce usage of bitmap - getting comparable outcome as lvm2 raid support uses. Add udev_wait after stopping md array - as in fact leg-device are still in use by target even command has finished. (mdadm --stop causes WATCH rule wakeup, and ioctl(STOP_ARRAY) returns IMHO to early - it should finish and fsync work on leg devices first).
* tests: check default policy is used when unspecifiedZdenek Kabelac2016-05-051-1/+1
| | | | | | If the policy is not given with policy settings we assume the default one is going to be used - it's users responsibility to pair them properly.
* tests: check for thin toolsZdenek Kabelac2016-05-051-0/+9
| | | | Test needs repair utils to be available.
* cleanup: use unsigned with EPOCH printf formatZdenek Kabelac2016-05-052-2/+3
|
* cleanup: enhance warning messageZdenek Kabelac2016-05-051-4/+6
| | | | | Add WARNING: for log_warn. Show device name which is marked missing.
* cleanup: just switch error pathZdenek Kabelac2016-05-051-8/+8
| | | | | Check for error case in if() like we normally do. Let code continue on success.
* lvcreate: improve --chunksize support for cached volume.Zdenek Kabelac2016-05-053-23/+23
| | | | | | | | Support parsing --chunksize option also when converting. Now user can use cache pool created with i.e. 32K chunksize, while in caching user can select 512K blocks. Tool is supposed to validate cache metadata size is big enough to support such chunk size. Otherwise error is shown.
* lvcreate: check for lv type and created segtypeZdenek Kabelac2016-05-051-9/+9
| | | | | | | | | | | | | | When creating LV - in some case we change created segment type (ATM for cache and snapshot) and we then manipulate with lv segment according to 'lp' segtype. Fix this by checking for proper type before accessing segment members. This makes command like: lvcreate --type cache-pool -L10 vg/cpool lvcreate -H -L10 --cachesettings migtation_threshold=10000 vg/cpool to pass since now tool correctly selects default cache policy.
* debug: enhance debug msg for cacheZdenek Kabelac2016-05-051-8/+12
|
* cache: use target_present_versionZdenek Kabelac2016-05-051-5/+3
| | | | | Using new function. Also add trace for error path.
* cleanup: gather version info with single checkZdenek Kabelac2016-05-053-7/+18
| | | | | As we already collect version info anyway, allow to use it through a single call (can makes logs shorter and saves ioctl).
* cache: add cache_set_params functionZdenek Kabelac2016-05-052-0/+39
| | | | | Wrapping function to handle setup of various cache related params. Reusable with lvcreate & lvconvert.