summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvmetad: connect from child polling processdev-dct-lvmetad-poll-connectDavid Teigland2016-04-191-0/+5
|
* 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
|
* test: lvmetad-warningDavid Teigland2016-04-192-36/+91
| | | | | | | | | | | | The test was a weak attempt at verifying the special combination of lvchange/vgchange -aay --sysinit, but was only looking for lvmetad connection warnings. Update the warning checks, and check the LV activation state directly which is the main point. Rename the test to reflect its purpose of checking the -aay --sysinit combination.
* test: lvmetad-overrideDavid Teigland2016-04-191-5/+27
|
* test: lvmetad-no-clusterDavid Teigland2016-04-191-3/+2
| | | | Update warning message check
* test: update lvmetad-disabledDavid Teigland2016-04-191-5/+61
| | | | | | | | | Update the check about lvmetad running but not used. Also add tests related to the new lvmetad disabled state. lvm1 metadata is used here to test the disabled state because lvm1 metadata is the first condition using the disabled state.
* test: update lvm1 testDavid Teigland2016-04-191-7/+3
| | | | | | Make it a generic lvm1 test, which should work with or without lvmetad now that lvmetad is just disabled when lvm1 is used.
* lvmetad: disable if command uses lvm1David Teigland2016-04-191-0/+8
| | | | | Alternatively, a command could return an error saying that lvm1 and lvmetad are not compatible.
* lvmetad: clear the disabled flag in lvmetadDavid Teigland2016-04-192-0/+39
| | | | | | | | | After a device rescan that repopulates lvmetad, if no reason for disabling lvmetad was seen (lvm1 metadata or duplicate PVs), then clear the disabled flag in lvmetad. This allows commands to resume using the lvmetad cache after the cause for disabling it has been removed.
* lvmetad: use the disabled flag in commandsDavid Teigland2016-04-196-4/+123
| | | | | | | | | Commands already check if the lvmetad token is valid, and if not, they rescan devices to repopulate lvmetad before running. Now, in addition to checking the lvmetad token, they also check if the lvmetad disabled flag is set. If so, they do not use the lvmetad cache and revert to disk scanning.
* lvmetad: set disabled flag in lvmetad if lvm1 metadata is foundDavid Teigland2016-04-192-0/+30
| | | | | When devices are being scanned, if lvm1 metadata is seen, tell lvmetad to set its disabled flag because of lvm1 metadata.
* lvmetad: add disabled stateDavid Teigland2016-04-194-5/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A global flag in lvmetad indicates it has been disabled. Other flags indicate the reason it was disabled. These flags can be queried using get_global_info. The lvmetactl debugging utility can set and clear the disabled flag in lvmetad. Nothing else sets the disabled flag yet. Commands will check these flags after connecting to lvmetad. If the disabled flag is set, the command will not use the lvmetad cache, but revert to disk scanning. To test this feature: $ lvmetactl get_global_info response = "OK" global_invalid = 0 global_disable = 0 disable_reason = "none" token = "filter:3041577944" $ vgs (should report VGs from lvmetad) $ lvmetactl set_global_disable 1 $ lvmetactl get_global_info response = "OK" global_invalid = 0 global_disable = 1 disable_reason = "DIRECT" token = "filter:3041577944" $ vgs WARNING: Not using lvmetad because the disable flag was set directly. (should report VGs without contacting lvmetad) $ lvmetactl set_global_disable 0 $ vgs (should report VGs from lvmetad)
* toollib: remove unneeded call in process_each_pvDavid Teigland2016-04-191-6/+0
| | | | | | | | | | | | | | | | | | | process_each_pv was doing: 1. lvmcache_seed_infos_from_lvmetad() sends pv_list request to lvmetad. 2. get_vgnameids() sends vg_list request to lvmetad. 3. _get_all_devices() first calls lvmcache_seed_infos_from_lvmetad(), which is a no-op if it's already been called. Because get_vgnameids() does not use the information from lvmcache_seed_infos_from_lvmetad(), it does not need to be called prior to get_all_devices where it is actually needed.
* metadata: don't repair shared VGsDavid Teigland2016-04-191-0/+8
| | | | When the in-use flag looks like it needs to be repaired.
* lvmlockd: skip unnecessary lvmetad cache updateDavid Teigland2016-04-191-12/+18
| | | | | | In cases where a VG is reread from disk, but the seqno matches what is currently in lvmetad, the metadata in lvmetad doesn't need to be updated.
* tests: use should for failing testZdenek Kabelac2016-04-181-2/+2
| | | | | It's better to use 'should' for failing test before it gets fixed, when we ignore failing result.
* tests: use bigger raid sizeZdenek Kabelac2016-04-181-2/+6
| | | | | To avoid problem with report of array in-sync use for now bigger raid size 64M.
* lvchange: improve refresh for merging thin volumeZdenek Kabelac2016-04-182-0/+11
| | | | | | When running lvchange --refresh on merging thin volume, try to deactivate snapshot thinLV in case it's preventing startup of merge process.
* snapshot: improve mergeZdenek Kabelac2016-04-181-40/+37
| | | | | | | | Improve code for snapshot merge for readabilty and also reduce number of tests needed to decide if merging can or cannot be started. (Further improving 9cccf5245a97a64f900f253fcf948edd5d7ba8c0)
* debug: use display_lvnameZdenek Kabelac2016-04-181-4/+6
|
* debug: update message in libdmZdenek Kabelac2016-04-182-1/+2
| | | | | | | | When dm_tree_find_node_by_uuid() fails to find passed uuid, report in lof_debug the complete original uuid, not the one stripped of LVM- prefix. TODO: inspect manipulation with LVM- prefix here.
* debug: fix error messageZdenek Kabelac2016-04-181-3/+3
| | | | | log_error is replaced with warn since the result of function is not result in command error.
* thin: improve recognizing of merge in progressZdenek Kabelac2016-04-181-16/+43
| | | | | | Rewrite too condensed condition in more readable form, wher decision are clearly separated and commented and also add debug messages for them.
* thin: check runtime table line for mergingZdenek Kabelac2016-04-182-1/+65
| | | | | | | To recognize in runtime if we are merging or not to make consistent decision between suspend and resume add function to parse thin table line when add merging thin device to the table.
* tests: fix check_lvmlockd_testDavid Teigland2016-04-151-1/+1
|
* activate: Improve snapshot merge initiationAlasdair G Kergon2016-04-154-11/+32
| | | | | | | | | | A snapshot merge into its origin cannot be initiated while the devices are in use. If there is outside interference (such as from udev), the suspend (preload) and resume stages can reach conflicting decisions about whether or not to proceed. Try to make the logic more robust by checking the inactive or live table during resume. (This is still not perfect.)
* activation: Log when pending snap merge postponed.Alasdair G Kergon2016-04-141-1/+3
|
* WHATS_NEW for lvmetad scanning changesDavid Teigland2016-04-141-0/+3
|
* activation: Add LV name to a debug message.Alasdair G Kergon2016-04-141-1/+1
|
* snapshot: Don't deactivate fictional snapshot LV.Alasdair G Kergon2016-04-142-2/+5
| | | | | | | Commit 971ab733b74e0ffecc3f9f60af48628cd3fba1db ("thin: activation of merging thin snapshot") also added an incorrect deactivation attempt for non-thin LVs: find_snapshot(lv)->lv is not designed to be activated and any attempt to deactivate it is incorrect.
* toollib: Fix misleading message when forking.Alasdair G Kergon2016-04-141-1/+1
| | | | | Commands like pvscan --background run entirely in the background, but others fork only for polling.
* refactor: factor out vg/lv/pv handling part from report_for_selection fnPeter Rajnoha2016-04-141-64/+96
| | | | | Functionality will be reused by future patches. Also, it makes the code more readable.
* tests: lvmetad-lvm1 fixDavid Teigland2016-04-131-2/+2
| | | | | workaround this test failure until the proper lvmetad/lvm1 fixes arrive shortly.
* lvmetad: add FIXME to commentDavid Teigland2016-04-131-2/+2
|
* lvmetad: preemptively check and rescan in commandsDavid Teigland2016-04-1312-125/+593
| | | | | | | | | | | | | | | | | | | | | | | | | | Move checking the lvmetad state, and the possible rescan, out of lvmetad_send() to the start of the command. Previously, the token mismatch and rescan would occur within lvmetad_send() for some other request. Now, the token mismatch is detected earlier, so the rescan can be done before the main command is in progress. Rescanning deep within the processing of another command will disturb the lvmcache state of that other command. A rescan already exists at the start of the command for the case where foreign VGs are going to be read. This same rescan is now also performed when there is an lvmetad token mismatch (from a changed global_filter). The commands pvscan/vgscan/lvscan/vgimport are excluded from this preemptive checking/rescanning for lvmetad because they want to do rescanning themselves explicitly. If rescanning devices fails, then lvmetad has not been correctly repopulated and should not be used, so make the command revert to not using lvmetad.
* debug: unify some tracing messagesZdenek Kabelac2016-04-123-22/+24
| | | | | | | Introduce FMTVGID - although it might be possibly better to ensure vgid is always \0 ended string. Unify some lvmcache reported messages.
* cleanup: gcc warn about comparing int with uintZdenek Kabelac2016-04-123-6/+6
|
* cleanup: avoid declaring var in the middle of codeZdenek Kabelac2016-04-121-4/+4
| | | | Easier to read code.
* rename function read_vgname to read_vgsummaryDavid Teigland2016-04-114-11/+15
| | | | The name did not clearly represent what it does.
* devcache: do not insert devices without device nodeZdenek Kabelac2016-04-112-0/+10
| | | | | | | | | | | | | | | When not obtaining device from udev, we are doing deep devdir scan, and at the same time we try to insert everything what /sys/dev/block knows about. However in case lvm2 is configured to use nonstardard devdir this way it will see (and scan) devices from a real system. lvm2 test suite is using its own test devdir with its own device nodes. To avoid touching real /dev devices, validate the device node exist in give dir and do not insert such device into a cache. With obtain list from udev this patch has no effect (the normal user path).
* devcache: index devices also without udevZdenek Kabelac2016-04-112-2/+6
| | | | | | | We have _insert_dirs() for udev and non-udev compilation. Compiling without udev missed to call dev_cache_index_devs(). Move the call after _insert_dirs() call so both compilation gets it.
* post-releaseAlasdair G Kergon2016-04-092-2/+2
|
* pre-releasev2_02_150Alasdair G Kergon2016-04-094-6/+6
|
* cleanup: avoid gcc warnsZdenek Kabelac2016-04-085-6/+6
| | | | | Some older systems may had global declaration to cause gcc warning. Rename for cases we don't care...
* cleanup: simplier to read conditionZdenek Kabelac2016-04-081-4/+5
| | | | | Make more readable what we are looking for and just test for KERNEL version at one place.
* cleanup: reuse _setup_taskZdenek Kabelac2016-04-081-42/+16
| | | | | | Shorten code and use common code from _setup_task. Reorder naming of major:minor sscanf (as later it's been also used swapped there was no real bug).
* dev_manager: device_is_usable does not flushZdenek Kabelac2016-04-082-1/+9
| | | | | | | When scanning if device is being usable as PV, we call STATUS - but this status should not cause any flushing. Skip also open_count information as it's not needed.
* activation: Skip another non-prefixed info ioctl.Alasdair G Kergon2016-04-083-29/+36
| | | | | _percent() also does a lookup by dm uuid. Also get kernel version from cmd->kernel_vsn.