summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* test: lvmetad-ambiguousdev-dct-lvmetad-disabled-7David Teigland2016-04-221-1/+1
| | | | update for duplicate changes
* lvmcache: also reset duplicate info in destroyDavid Teigland2016-04-221-0/+4
|
* test: pv-duplicate-uuidDavid Teigland2016-04-221-6/+30
| | | | update for duplicate changes
* test: process-each-duplicate-pvsDavid Teigland2016-04-221-118/+366
| | | | Update for new duplicate processing.
* lvmetad: disable if device scan failsDavid Teigland2016-04-223-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: add warning prefixDavid Teigland2016-04-221-4/+4
|
* lvmcache: prefer duplicate device used by LVsDavid Teigland2016-04-221-8/+16
|
* lvmcache: process duplicate PVs directlyDavid Teigland2016-04-226-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-226-222/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-223-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-221-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-221-0/+6
| | | | | When devices are being scanned, if duplicate PVs are seen, tell lvmetad to set its disabled flag because of duplicate PVs.
* 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
|
* debug: move misplaced log_debugZdenek Kabelac2016-04-211-1/+1
| | | | It should log action before taking it instead of only in error path.
* configure: respect --disable-lvmetad/lvmpolldZdenek Kabelac2016-04-212-22/+26
| | | | | | When user requested on cmdline disabling of lvmetad/lvmpoll, respect it and when lvmlockd requires these daemon, Error configure with clear message about misconfiguration.
* configure: detect for /var/lock dirZdenek Kabelac2016-04-203-4/+14
| | | | | Detecs systems with /run/lock dir and use such path directly instead of /var/lock.
* lvmetad: connect from forked polling processDavid Teigland2016-04-201-0/+5
| | | | | | With commit 5e9e43074a6c, lvmetad connections are now made explicitly, so a new connection must be created from a child created for polling.
* test: lvmetad-overrideDavid Teigland2016-04-191-1/+3
| | | | Fix test case where a warning appears when it's not expected.
* lvmetad: rework command connection setup and checkingDavid Teigland2016-04-1918-187/+144
| | | | | | | | | | | | | | The lvmetad connection is created within the init_connections() path during command startup, rather than via the old lvmetad_active() check. The old lvmetad_active() checks are replaced with lvmetad_used() which is a simple check that tests if the command is using/connected to lvmetad. The old lvmetad_set_active(cmd, 0) calls, which stopped the command from using lvmetad (to revert to disk scanning), are replaced with lvmetad_make_unused(cmd).
* lvmetad: use defines for disabled reason stringsDavid Teigland2016-04-194-12/+17
|