summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* test: vgcfgbackup-lvm1dev-dct-lvmetad-disabled-9David Teigland2016-04-261-0/+36
| | | | The lvm1 part of vgcfgbackup-usage.
* test: vgcfgbackup-usageDavid Teigland2016-04-261-14/+0
| | | | Split the lvm1 part into a separate test.
* test: vgsplit-usageDavid Teigland2016-04-261-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-04-261-1/+1
| | | | update for duplicate changes
* test: pv-duplicate-uuidDavid Teigland2016-04-261-6/+30
| | | | update for duplicate changes
* test: process-each-duplicate-pvsDavid Teigland2016-04-261-118/+367
| | | | Update for new duplicate processing.
* lvmetad: disable if device scan failsDavid Teigland2016-04-263-15/+32
| | | | | | | | 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: prefer duplicate device used by LVsDavid Teigland2016-04-261-8/+16
|
* lvmcache: process duplicate PVs directlyDavid Teigland2016-04-266-124/+171
| | | | | | | | | | | | | | | | | | | | 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.
* lvmcache: improve duplicate PV handlingDavid Teigland2016-04-266-222/+375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/strict_pv_device can be set to 1 which will disallow modifying a VG when it contains PVs with duplicate devices. Set to 0 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-04-263-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-04-261-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-04-261-0/+6
| | | | | When devices are being scanned, if duplicate PVs are seen, tell lvmetad to set its disabled flag because of duplicate PVs.
* udev: rules: add comments explaining subsystem-specific rulesPeter Rajnoha2016-04-261-0/+14
|
* udev: rules: remove mpath from 10-dm.rules, superseded by 11-dm-mpath.rules ↵Peter Rajnoha2016-04-252-4/+1
| | | | | | | | | | | | | | (mpath>=0.6.0) Multipath 0.6.0 contains new 11-dm-mpath.rules which supersede the rule that was in 10-dm.rules. The 11-dm-mpath.rules are also more complete, fixing several other issues. Using the new 11-dm-mpath.rules from multipath-tools >= 0.6.0 is strongly recommended for proper DM multipath functionality! See also: http://christophe.varoqui.free.fr http://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=blob;f=multipath/11-dm-mpath.rules
* cleanup: do not mention segment in warning message if device not found for a ↵Peter Rajnoha2016-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | PV when checking used/assumed devs for an LV [0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]' WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Couldn't find device for segment belonging to fedora/root while checking used and assumed devices. WARNING: Couldn't find device for segment belonging to fedora/swap while checking used and assumed devices. PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m [unknown] fedora lvm2 a-m 19.49g 0 Probably not worth mentioning "segments" here, just state that devices for an LV can't be all found during the check - it's less mysterious for user then: [0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]' WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Couldn't find all devices for LV fedora/root while checking used and assumed devices. WARNING: Couldn't find all devices for LV fedora/swap while checking used and assumed devices. PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m [unknown] fedora lvm2 a-m 19.49g 0
* metadata: log warning instead of error if device not found while checking ↵Peter Rajnoha2016-04-251-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | used and assumed devs When checking assumed PVs against real devices used for LVs and if there's no device assigned for an assumed PV (e.g. due to filters), do log_warn instead of log_error and continue checking LV segments and associated assumed PVs further, just like we do log_warn elsewhere in this situation. This way user will see the warning for each LV which couldn't be checked completely against real PVs used. Before, we logged only the very first occurence of missing device for an LV in a VG and we returned from the function doing this check for all the LVs in VG immediately which may be a bit misleading because it didn't tell user about all the other LVs and whether they could be checked or not. For example, we have this setup: [0] fedora/~ # pvs PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m /dev/vda2 fedora lvm2 a-- 19.49g 0 [0] fedora/~ # lvs -o+devices LV VG Attr LSize Devices root fedora -wi-ao---- 19.00g /dev/vda2(0) swap fedora -wi-ao---- 500.00m /dev/vda2(4864) Before this patch (only the very first LV in a VG is logged to have a problem while checking used and assumed devices): [0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]' WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. Couldn't find device for segment belonging to fedora/root while checking used and assumed devices. PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m [unknown] fedora lvm2 a-m 19.49g 0 With this patch applied (all LVs where we hit problem while checking used and assumed devices are logged and it's warning, not error): [0] fedora/~ # pvs --config 'devices/filter=["a|/dev/sda|", "r|.*|"]' WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Device for PV Qcxpcy-XgtP-UD3s-PmG0-qLyE-Z0ho-DYsxoz not found or rejected by a filter. WARNING: Couldn't find device for segment belonging to fedora/root while checking used and assumed devices. WARNING: Couldn't find device for segment belonging to fedora/swap while checking used and assumed devices. PV VG Fmt Attr PSize PFree /dev/sda lvm2 --- 128.00m 128.00m [unknown] fedora lvm2 a-m 19.49g 0
* post-releaseAlasdair G Kergon2016-04-234-2/+8
|
* pre-releasev2_02_151Alasdair G Kergon2016-04-235-5/+15
|
* tests: drop cluster testing with pvmoveZdenek Kabelac2016-04-221-1/+1
| | | | Unwanteadly enabled in previous check-in.
* coverity: check for sys error in clock callZdenek Kabelac2016-04-221-2/+11
|
* coverity: ignore some dm_strncpy resultsZdenek Kabelac2016-04-221-5/+5
| | | | | | Using them only for debug so ignorable. Also don't mark stack char buffer alignment, compiler already knows what's the best here.
* coverity: keep expression using 64bitZdenek Kabelac2016-04-221-1/+1
| | | | Use 64bit input to remain with whole evaluation in 64bit.
* coverity: is_used_pv needs valid pv pointerZdenek Kabelac2016-04-221-3/+2
|
* tests: make test independent on usage [] for hidden LVsZdenek Kabelac2016-04-225-29/+31
|
* cache: fix previous change and correct ()Zdenek Kabelac2016-04-221-2/+1
| | | | 412f09ca332c644e08421e289a3e8d54890971ba missed parentheses.
* libdm-stats: check for empty region and area listsBryn M. Reeves2016-04-221-0/+8
| | | | | | | | | | | | | Check that @stats_list and @stats_print returned data in the _stats_parse_list() and _stats_parse_region() functions before attempting to operate on region and area values. This avoids a coverity warning since fgets() could potentially return no data from the memory buffer returned by the ioctl. In both cases the ioctl would return an error, preventing these functions from running, however it is cleaner to test for the condition explicitly and fail in those cases.
* tests: keep using [] for hidden volumesZdenek Kabelac2016-04-221-1/+0
| | | | | | Figure out which test needs to see hidden volumes without []. But normally use [] for debug printing in tests. It's confusing otherwise.
* coverity: drop abadoing objectZdenek Kabelac2016-04-221-17/+11
| | | | | As mempool is destroyed on by caller don't bother for mempool freeing here.
* coverity: avoid using signed types for single bitsZdenek Kabelac2016-04-221-2/+2
|
* coverity: return non-null string with internal errorZdenek Kabelac2016-04-221-9/+9
| | | | | While we return internal error we should not let tool crash on NULL access, so return valid string for such case.
* coverity: use wider type for whole expressionZdenek Kabelac2016-04-221-2/+2
| | | | | Coverity likes when the types are same through the whole expression. And since dev_t is 64b - widen int type early.
* coverity: drop unused header fileZdenek Kabelac2016-04-221-1/+0
|
* coverity: fix error pathsZdenek Kabelac2016-04-222-3/+4
| | | | | | Patch 74e704bb4465960b361711c890733cbae1f06e42 missed to update error path. Since now we just need to 'return_0' as 'dmt is NULL and thus may not be destroyed.
* coverity: fix memory accessZdenek Kabelac2016-04-222-10/+7
| | | | | | | | Commit 52e0d0db4460d90172e9bd45b9ef30e7f4f75ae7 introduced regression as code may access buf[0 - 1]. Reorder code to first remove '\n' and then check buffer size for empty.
* cleanup: use kdev_t header in lvm treeZdenek Kabelac2016-04-221-3/+1
| | | | | Reuse libdm header in lvm so we have single definition of MAJOR/MINOR/MKDEV macros in use.
* cleanup: simplify codeZdenek Kabelac2016-04-221-3/+1
| | | | dm_strncpy() also check the size fits.
* WHATS_NEW: disable lvmetad for lvm1David Teigland2016-04-211-0/+1
|
* activate: Hide errors when snapshot merge delayed.Alasdair G Kergon2016-04-217-18/+30
|
* poll daemon: only call lvmetad_connect when neededDavid Teigland2016-04-211-1/+1
| | | | | | When lvm is not using lvmetad, the lvmetad_connect() in the forked polling process is not needed and was generating unwanted warnings.
* tests: GLIBC decided to obsolete readdir_rZdenek Kabelac2016-04-211-5/+13
| | | | Keep the code compilatible without warnings on newer glibc.
* lvmetad: warn about making changes while not using lvmetadDavid Teigland2016-04-211-1/+3
| | | | | | | | | | | | | If lvmetad is running, and a command opts to not use it (--config global/use_lvmetad=0), and the command changes metadata, then the metadata change is not visible to lvmetad. Subsequent commands using lvmetad to change metadata may cause corruption based on the invalid lvmetad state. Eventually we can set the disabled state in lvmetad to prevent this problem, but for now print a warning about the possibility.
* lvmetad: fix compile without lvmetadDavid Teigland2016-04-211-0/+1
| | | | Last commit was missing stub function.
* lvmetad: check pid for warning caseDavid Teigland2016-04-213-1/+14
| | | | | | | | When command is not using lvmetad because use_lvmetad=0 in the config, but the lvmetad pidfile exists, print a warning (previously this checked for the socket existing instead of the pidfile existing.)
* lvmetad: check for socket in connectDavid Teigland2016-04-211-2/+2
| | | | | | We can connect if the socket is present, even though the pidfile may not exist, since systemd may start the process when the socket is opened.
* display: Avoid internal snapshot LV names in msgs.Alasdair G Kergon2016-04-214-2/+21
| | | | | | | vg/snapshotN should not appear anywhere. No code should be showing this, but it was noticed in some logs last week and we can deal with it in display_lvname().
* lvmetad: fix compilation without lvmetad#Zdenek Kabelac2016-04-211-3/+3
|
* tests: minor updateZdenek Kabelac2016-04-211-3/+7
|
* tests: still show systems stas when command has not produced debug.log fileZdenek Kabelac2016-04-211-1/+2
| | | | | When no debug.log* file is present whole stacktracking was skipped. Add extra test the file exists to catch this case.
* tests: document make parametr for tracing aux scriptsZdenek Kabelac2016-04-211-0/+1
|